Skip to content

Commit

Permalink
Added test for new removeSyncStorageValue method
Browse files Browse the repository at this point in the history
  • Loading branch information
NikkelM committed Nov 25, 2023
1 parent 47caf12 commit f01adc3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/chromeStorage.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import expect from 'expect.js';

import { configSync, setSyncStorageValue, getUserQuotaRemainingToday } from '../src/chromeStorage.js';
import { configSync, setSyncStorageValue, removeSyncStorageValue, getUserQuotaRemainingToday } from '../src/chromeStorage.js';
import { configSyncDefaults } from '../src/config.js';

describe('chromeStorage', function () {
Expand Down Expand Up @@ -41,7 +41,6 @@ describe('chromeStorage', function () {
});

context('setSyncStorageValue()', function () {

it('should set the value in the configSync object', async function () {
await setSyncStorageValue("testKey1", "testValue1");

Expand Down Expand Up @@ -75,6 +74,20 @@ describe('chromeStorage', function () {
});
});

context('removeSyncStorageValue()', function () {

it('should remove the value from the configSync object', async function () {
await setSyncStorageValue("testKey4", "testValue4");

expect(configSync).to.have.key("testKey4");
expect(configSync.testKey4).to.be("testValue4");

await removeSyncStorageValue("testKey4");

expect(configSync).to.not.have.key("testKey4");
});

});
context('getUserQuotaRemainingToday()', function () {

it('should return the number of requests the user can still make to the Youtube API today', async function () {
Expand Down

0 comments on commit f01adc3

Please sign in to comment.