aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/notif-faces-test.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/notif-faces-test.js b/tools/notif-faces-test.js
index 7d1c740..18a2f00 100644
--- a/tools/notif-faces-test.js
+++ b/tools/notif-faces-test.js
@@ -83,14 +83,20 @@ try {
await page.evaluate(() => { const b = [...document.querySelectorAll('button')].find((e) => /message/i.test(e.getAttribute('aria-label') || '')); if (b) b.click(); });
await sleep(3000);
console.log('\n[on the chat home, before opening Notifications]');
- check('the cached list is there (the row counts it)', await page.evaluate(() => !!document.querySelector('.notifs-row, .chat-thread-row') && /Notifications/.test(document.body.innerText)));
+ check('the cached list is there (the nav button shows it waiting)', await page.evaluate(() =>
+ [...document.querySelectorAll('.app-nav-button.unread')].some((n) => /Notifications/i.test(n.getAttribute('aria-label') || ''))));
check('the actors\' profiles were asked for', (await page.evaluate(() => window.__profileReqs)) > 0);
check('...and their pictures fetched', faceHits.length >= 5, faceHits.length + ' of 5');
const profs = await page.evaluate((k) => Object.keys(JSON.parse(localStorage.getItem(k + ':profiles') || '{}')).length, base);
check('...and remembered in the profile cache', profs >= 5, profs + ' profiles');
console.log('\n[opening the page]');
- await page.evaluate(() => { const e = [...document.querySelectorAll('.item')].find((n) => /Notifications/.test(n.textContent)); if (e) e.click(); });
+ // Notifications lives in the bottom nav now (it was a row on the chat home)
+ check('the bottom nav has a Notifications button', await page.evaluate(() => {
+ const e = [...document.querySelectorAll('.app-nav-button')].find((n) => /Notifications/i.test(n.getAttribute('aria-label') || ''));
+ if (e) e.click();
+ return !!e;
+ }));
await sleep(150); // the first paint, not a settled one
const faces = await page.evaluate(() => [...document.querySelectorAll('.notes-feed .chat-avatar')].map((a) => a.classList.contains('ava-img') || (a.style.backgroundImage || '').includes('url')));
check('every row paints with a face on the first frame', faces.length >= 5 && faces.every(Boolean), JSON.stringify(faces));