Fixed some bugs
This commit is contained in:
@ -3,7 +3,6 @@ import {LocalStorage, SessionStorage} from "../src";
|
||||
const CUSTOM_KEY = '_MY_KEY'
|
||||
const ENCRYPTION_KEY = 'abc123';
|
||||
|
||||
|
||||
class TestType {
|
||||
constructor(public first: string, public last: string) { }
|
||||
fullName() { return `${this.last}, ${this.first}`; }
|
||||
@ -44,6 +43,12 @@ describe('Webstorage Decorators', () => {
|
||||
expect(localStorage.getItem('localStorage')).toBe(JSON.stringify(testValue));
|
||||
expect(testComponent.localStorage).toBe(testValue);
|
||||
});
|
||||
test('Arrays', () => {
|
||||
const testValue = [Math.random(), Math.random(), Math.random()];
|
||||
testComponent.localStorage = testValue;
|
||||
expect(localStorage.getItem('localStorage')).toBe(JSON.stringify(testValue));
|
||||
expect(testComponent.localStorage).toBe(testValue);
|
||||
});
|
||||
test('String Value', () => {
|
||||
const testValue = 'SOMETHING_RANDOM';
|
||||
testComponent.localStorage = testValue;
|
||||
@ -99,6 +104,12 @@ describe('Webstorage Decorators', () => {
|
||||
expect(sessionStorage.getItem('sessionStorage')).toBe(JSON.stringify(testValue));
|
||||
expect(testComponent.sessionStorage).toBe(testValue);
|
||||
});
|
||||
test('Arrays', () => {
|
||||
const testValue = [Math.random(), Math.random(), Math.random()];
|
||||
testComponent.sessionStorage = testValue;
|
||||
expect(sessionStorage.getItem('sessionStorage')).toBe(JSON.stringify(testValue));
|
||||
expect(testComponent.sessionStorage).toBe(testValue);
|
||||
});
|
||||
test('String Value', () => {
|
||||
const testValue = 'SOMETHING_RANDOM';
|
||||
testComponent.sessionStorage = testValue;
|
||||
|
Reference in New Issue
Block a user