Skip to content

Commit

Permalink
Fix bugs in e2e test code
Browse files Browse the repository at this point in the history
  • Loading branch information
elainewlin committed Feb 24, 2025
1 parent 0c8b3af commit ec9816b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion test/e2e/home.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ describe("Home page", function() {
});

it("shows navigation links", async () => {
const expectedLinks = ["Tools", "Render chords", "Convert tabs", "Guides"];
const expectedLinks = [
"Account",
"Log in",
"Sign up",
"Tools",
"Render chords",
"Convert tabs",
"Add/edit songs",
"Guides",
];
const navLinks = await getAllHtmlForSelector(this.page, ".nav-link");
assert.deepStrictEqual(navLinks, expectedLinks);
});
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/song.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ describe("Song view", function() {
});

it("shows the chords + lyrics", async () => {
const chordLine = "AmDeath doesnt discriminate F";
const chordLine = "AmLove doesn't discriminate C";
const lines = await getAllTextForSelector(this.page, ".chordLyricLine");
assert(lines.includes(chordLine));
});

it("shows lines without chords", async () => {
const tabLine = "preacher, preacher, preacher";
const tabLine = "wait for it, wait for it, wait for it,";
const lines = await getAllTextForSelector(this.page, ".line");
assert(lines.includes(tabLine));
});

it("shows a bunch of chords", async () => {
await this.page.click("#instrument-ukulele");
const knownChords = ["C", "Am", "Em", "F", "G", "Gsus4"];
const knownChords = ["C", "Am", "Em", "Gsus4", "F6", "F", "Fmaj7", "C6"];
await checkChords(this.page, knownChords);
});

Expand Down

0 comments on commit ec9816b

Please sign in to comment.