aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-07-29 13:02:41 +1000
committerYuchen Pei <hi@ypei.me>2022-07-29 13:02:41 +1000
commitbcb819d0091557f2e64f2271b9ae15c7a7bce792 (patch)
tree1e4b38d2f9cfb0ea7547db1777e5cccead067d05
parente264ae8dd3af9544261af15c4b39a97657db90c7 (diff)
adding a test for prefs default
-rw-r--r--test/spec/LibreJSSpec.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/spec/LibreJSSpec.js b/test/spec/LibreJSSpec.js
index 5632e9f..501efa7 100644
--- a/test/spec/LibreJSSpec.js
+++ b/test/spec/LibreJSSpec.js
@@ -303,7 +303,7 @@ describe('LibreJS\' components', () => {
setTimeout(async () => {
const [frameBody] = await browser.tabs.executeScript(tab.id, {
code: 'document.getElementById("_LibreJS_frame").contentWindow.document.body.innerHTML'
- })
+ });
expect(frameBody).not.toContain('About Us');
expect(frameBody).toContain('Contact Us');
expect(frameBody).toContain('Website Feedback');
@@ -313,6 +313,19 @@ describe('LibreJS\' components', () => {
});
});
+ describe('The prefs', () => {
+ it('should have the defaults', async () => {
+ const defaults = await browser.storage.local.get(['pref_subject', 'pref_body']);
+ expect(defaults).toEqual({
+ pref_subject: 'Issues with Javascript on your website',
+ pref_body: `Please consider using a free license for the Javascript on your website.
+
+[Message generated by LibreJS. See https://www.gnu.org/software/librejs/ for more information]
+`
+ });
+ });
+ });
+
afterAll(async () => {
await browser.tabs.remove(tab.id);
browser.tabs.update((await browser.tabs.getCurrent()).id, { active: true });