From b96bf9ec6a977d606664eb7dfc2007884785ff16 Mon Sep 17 00:00:00 2001 From: Philipp Dunkel Date: Fri, 2 Oct 2026 18:11:21 +0200 Subject: [PATCH] Wait for the article before checking its citation badges The document list is filled in, showing post.md, before the article opens and the badges are counted, so the next test could read them too early. It failed that way on a slower runner in the release workflow. --- test/app.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/app.test.ts b/test/app.test.ts index 4c95584..4e40e4d 100644 --- a/test/app.test.ts +++ b/test/app.test.ts @@ -60,7 +60,8 @@ describe("app", { skip: !hasChrome && "no Chrome installation found" }, () => { test("starts with the folder picker, then opens a project", async () => { assert.ok(await q(`!document.querySelector('#welcome').hidden`)); await openFolder(project); - assert.ok(await until(`document.querySelectorAll('.card').length === 9 && document.querySelector('#doc-select').value === 'post.md'`)); + // The document list is filled in before the article opens, so wait for its text too. + assert.ok(await until(`document.querySelectorAll('.card').length === 9 && document.querySelector('#doc-select').value === 'post.md' && document.querySelector('.cm-content').innerText.includes('Every post I write')`)); assert.equal(app.settings.get().recent[0], project); }); -- knotmirror 0.0.1