Skip to content

Commit

Permalink
fix: navbar tests and expose safelist (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
deer authored Jan 11, 2024
1 parent 4bbd906 commit 13ae8ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
1 change: 1 addition & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { blogPlugin } from "./src/plugin/blog.ts";
export type { BlogOptions } from "./src/plugin/blog.ts";
export { safelist } from "./src/safelist.ts";
30 changes: 14 additions & 16 deletions tests/responsive_navbar_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Deno.test({
name: "navbar test with large browser",
async fn(t) {
await withPage(
"./tests/responsive_navbar_fixture/main.ts",
"./tests/responsive_navbar_fixture/dev.ts",
async (page, address) => {
// Setup
await page.goto(`${address}`, { waitUntil: "load" });
Expand Down Expand Up @@ -36,7 +36,7 @@ Deno.test({
name: "navbar test with small browser",
async fn(t) {
await withPage(
"./tests/responsive_navbar_fixture/main.ts",
"./tests/responsive_navbar_fixture/dev.ts",
async (page, address) => {
await page.goto(`${address}`, { waitUntil: "load" });
const navbar = await page.waitForSelector("nav");
Expand All @@ -51,20 +51,18 @@ Deno.test({
assertEquals(itemsHidden, true);
});

// await t.step(
// "navbar items should be visible after clicking hamburger menu",
// async () => {
// // console.log(await page.content());
// await delay(1000);
// await page.click("label");
// const itemsVisible = await page.$$eval(
// "nav > ul > li > a",
// (elements) =>
// elements.every((e) => getComputedStyle(e).display !== "none"),
// );
// assertEquals(itemsVisible, true);
// },
// );
await t.step(
"navbar items should be visible after clicking hamburger menu",
async () => {
await page.click("label");
const itemsVisible = await page.$$eval(
"nav > ul > li > a",
(elements) =>
elements.every((e) => getComputedStyle(e).display !== "none"),
);
assertEquals(itemsVisible, true);
},
);
},
{ args: ["--window-size=375,812"] },
);
Expand Down

0 comments on commit 13ae8ca

Please sign in to comment.