aboutsummaryrefslogtreecommitdiff
path: root/test/spec
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-07-28 10:37:00 +1000
committerYuchen Pei <hi@ypei.me>2022-07-28 10:37:00 +1000
commit395df086e12e62ae55ebc7012d94896ca8958394 (patch)
treeb1c4c2fd20d65c4de780a76b76204806b6204009 /test/spec
parent2bdf1e590b70724f80beb5702ebb05331973bbc9 (diff)
adding a test for contact finder
Diffstat (limited to 'test/spec')
-rw-r--r--test/spec/LibreJSSpec.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/spec/LibreJSSpec.js b/test/spec/LibreJSSpec.js
index aa5c167..1bb47ab 100644
--- a/test/spec/LibreJSSpec.js
+++ b/test/spec/LibreJSSpec.js
@@ -296,6 +296,22 @@ describe('LibreJS\' components', () => {
done();
}, 100);
});
+ it('should display the correct contact info in 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 [frameBody] = await browser.tabs.executeScript(tab.id, {
+ code: 'document.getElementById("_LibreJS_frame").contentWindow.document.body.innerHTML'
+ })
+ console.log(frameBody);
+ expect(frameBody).not.toContain('About Us');
+ expect(frameBody).toContain('Contact Us');
+ expect(frameBody).toContain('Website Feedback');
+ expect(frameBody).toContain('lib@re.js');
+ done();
+ }, 200);
+ });
});
afterAll(async () => {