section.spec.js 1012 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { setMobile, setDesktop } from "../utils";
  2. describe("Layout/Section", () => {
  3. beforeEach(() => {
  4. cy.visit("http://127.0.0.1:4000/cyp/layout/section/");
  5. setDesktop();
  6. });
  7. it("has a Section", () => {
  8. cy.get(".section").should("exist");
  9. });
  10. it("has a correct Section", () => {
  11. cy.get("#section").then(($) => {
  12. const cs = window.getComputedStyle($[0]);
  13. expect(cs.padding).to.equal("48px");
  14. });
  15. setMobile();
  16. cy.get("#section").then(($) => {
  17. const cs = window.getComputedStyle($[0]);
  18. expect(cs.padding).to.equal("48px 24px");
  19. });
  20. });
  21. it("has a correct medium Section", () => {
  22. cy.get("#section-medium").then(($) => {
  23. const cs = window.getComputedStyle($[0]);
  24. expect(cs.padding).to.equal("144px 72px");
  25. });
  26. });
  27. it("has a correct large Section", () => {
  28. cy.get("#section-large").then(($) => {
  29. const cs = window.getComputedStyle($[0]);
  30. expect(cs.padding).to.equal("288px 96px");
  31. });
  32. });
  33. });