diff options
author | Yuchen Pei <hi@ypei.me> | 2022-07-25 18:57:08 +1000 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2022-07-25 18:57:08 +1000 |
commit | cbfe3b95c0fd0acf228198de2bb7d48a52a75912 (patch) | |
tree | 6fdce6c5e993168b8b5d0a34aeebe0ce314675d7 | |
parent | 57cb7b93c5530b80b4e5c4c2cce77c6164d5cf03 (diff) |
adding a test for the contact finder
-rw-r--r-- | test/spec/LibreJSSpec.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/spec/LibreJSSpec.js b/test/spec/LibreJSSpec.js index 9e96af5..aa5c167 100644 --- a/test/spec/LibreJSSpec.js +++ b/test/spec/LibreJSSpec.js @@ -282,6 +282,22 @@ describe('LibreJS\' components', () => { expect(scriptInfo).toBeNull(); }); }); + + describe('Contact finder', () => { + it('should display the contact finder iframe', async (done) => { + await browser.runtime.connect({ name: "port-from-cs" }).postMessage({ invoke_contact_finder: 1 }); + // Direct await / async does not work as executeScript does not wait + // for the listener + setTimeout(async () => { + const frame = await browser.tabs.executeScript(tab.id, { + code: 'document.getElementById("_LibreJS_frame").outerHTML' + }) + expect(frame).toBeTruthy(); + done(); + }, 100); + }); + }); + afterAll(async () => { await browser.tabs.remove(tab.id); browser.tabs.update((await browser.tabs.getCurrent()).id, { active: true }); |