From 322fd0373b4fa2245dec87a19c26a1972e48ca2b Mon Sep 17 00:00:00 2001 From: Quentin Date: Mon, 23 Sep 2024 22:32:06 +0200 Subject: [PATCH] React: Simplify tests --- .../common/services/storage.test.ts.mustache | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/common/services/storage.test.ts.mustache b/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/common/services/storage.test.ts.mustache index 5c06cddd11c..b4c33e2a847 100644 --- a/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/common/services/storage.test.ts.mustache +++ b/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/common/services/storage.test.ts.mustache @@ -2,17 +2,8 @@ import { describe, it, expect } from 'vitest'; import { getLocalStorage, removeLocalStorage, setLocalStorage } from '@/common/services/storage'; -describe('setLocalStorage function', () => { - it('should set item in localStorage', () => { - const key = 'key'; - const value = 'value'; - setLocalStorage(key, value); - expect(getLocalStorage(key)).toEqual(value); - }); -}); - -describe('removeLocalStorage function', () => { - it('should remove item from localstorage', () => { +describe('storage functions', () => { + it('should add and remove item from localstorage', () => { const key = 'key'; const value = 'value'; setLocalStorage(key, value); @@ -21,12 +12,3 @@ describe('removeLocalStorage function', () => { expect(getLocalStorage(key)).toBeNull(); }); }); - -describe('getLocalStorage function', () => { - it('should get item from localstorage', () => { - const key = 'key'; - const value = 'value'; - setLocalStorage(key, value); - expect(getLocalStorage(key)).toEqual(value); - }); -});