Skip to content

Commit

Permalink
Update string quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
CountNick committed Jun 18, 2024
1 parent 08e63e3 commit d692c13
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions test/preferences.test.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
import Preferences from '../src/preferences';
import Preferences from "../src/preferences";

describe('Preferences', () => {

const FOO = { id: 'foo', accepted: true };
const BAR = { id: 'bar', accepted: false };
describe("Preferences", () => {
const FOO = { id: "foo", accepted: true };
const BAR = { id: "bar", accepted: false };
const COOKIES = [FOO, BAR];

const preferences = Preferences();

beforeEach(() => preferences.store([]));

test('get', () => {
expect(preferences.get('foo')).toBeUndefined();
test("get", () => {
expect(preferences.get("foo")).toBeUndefined();
preferences.store(COOKIES);
expect(preferences.get('foo')).toEqual(FOO);
expect(preferences.get("foo")).toEqual(FOO);
});

test('getAll', () => {
test("getAll", () => {
expect(preferences.getAll()).toEqual([]);
preferences.store(COOKIES);
expect(preferences.getAll()).toEqual(COOKIES);
expect(preferences.getAll().length).toEqual(2);
});

test('getState', () => {
expect(preferences.getState('foo')).toBeUndefined();
test("getState", () => {
expect(preferences.getState("foo")).toBeUndefined();
preferences.store(COOKIES);
expect(preferences.getState('foo')).toEqual(true);
expect(preferences.getState('bar')).toEqual(false);
expect(preferences.getState("foo")).toEqual(true);
expect(preferences.getState("bar")).toEqual(false);
});

test('hasPreferences', () => {
test("hasPreferences", () => {
expect(preferences.hasPreferences()).toBeFalsy();
preferences.store(COOKIES);
expect(preferences.hasPreferences()).toBeTruthy();
});

test('store', () => {
test("store", () => {
preferences.store(COOKIES);
expect(preferences.getAll()).toEqual(COOKIES);
preferences.store([]);
expect(preferences.getAll()).toEqual([]);
});

});

0 comments on commit d692c13

Please sign in to comment.