From 0df6e6bf45cd22fb52be529ff0a53a89669dc721 Mon Sep 17 00:00:00 2001
From: Anggie Alava tags", () => {
+ expect(ols.length).toBe(2)
});
- afterEach(() => {
- jest.resetModules();
+ test("There should be two
tags", () => {
+ expect(uls.length).toBe(2)
});
-
- it("You should not change the existing head tag elements", function () {
- let head = document.querySelector('head');
- let title = head.querySelector('title').innerHTML;
-
- expect(title).toBe('03 List styling')
- })
-
- // Test in progress:
- // it("The lists should be correctly styled", function() {
- // const uls = document.querySelectorAll("ul");
- // const ols = document.querySelectorAll("ol");
- // console.log(uls);
- // console.log(ols);
-
- // var style1 = window.getComputedStyle(ols[0]);
- // var style2 = window.getComputedStyle(uls[0]);
- // var style3 = window.getComputedStyle(ols[1]);
- // var style4 = window.getComputedStyle(uls[1]);
-
-
- // expect(style1["listStyleType"]).toBe("lower-alpha");
- // expect(style2["listStyleType"]).toBe("square");
- // expect(style3["listStyleType"]).toBe("armenian");
- // expect(style4["listStyleType"]).toBe("none");
-
- // });
-});
\ No newline at end of file
+ test("The first Ol must have a list-style-type = lower-alpha ", () => {
+ document.querySelector(
+ "head"
+ ).innerHTML = ``;
+ let firstOl = window.getComputedStyle(ols[0]);
+ expect(firstOl["list-style-type"]).toBe("lower-alpha");
+ });
+ test("The second Ol must have a list-style-type = square ", () => {
+ document.querySelector(
+ "head"
+ ).innerHTML = ``;
+ let secondOl = window.getComputedStyle(ols[1]);
+ expect(secondOl["list-style-type"]).toBe("square");
+ });
+ test("The first Ul must have a list-style-type = armenian ", () => {
+ document.querySelector(
+ "head"
+ ).innerHTML = ``;
+ let firstUl = window.getComputedStyle(uls[0]);
+ expect(firstUl["list-style-type"]).toBe("armenian");
+ });
+ test("The second Ul must have a list-style-type = none ", () => {
+ document.querySelector(
+ "head"
+ ).innerHTML = ``;
+ let secondUl = window.getComputedStyle(uls[1]);
+ expect(secondUl["list-style-type"]).toBe("none");
+ expect(secondUl["margin"]).toBe("0px");
+ expect(secondUl["padding"]).toBe("0px");
+ });
+})