Skip to content

Commit 65e9f49

Browse files
committed
Merge branch 'add-ims-job-scheduler-api-url-to-config-#1676' into catalogue-catagories-flagging-#1659
2 parents 2f18f90 + 54aefec commit 65e9f49

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

cypress/support/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Cypress.Commands.add('setMode', ({ admin = false, critical = false } = {}) => {
162162

163163
// Toggle critical mode
164164
if (critical) {
165-
cy.findByRole('menuitem', { name: 'Switch to critical mode on' }).click();
165+
cy.findByRole('menuitem', { name: 'Switch critical mode on' }).click();
166166
}
167167
});
168168

src/common/storage.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createBooleanLocalStorage } from './storage';
22

3-
describe('isAdminModeStorage', () => {
4-
const isAdminModeStorage = createBooleanLocalStorage('test');
3+
describe('createBooleanLocalStorage', () => {
4+
const testBooleanStorage = createBooleanLocalStorage('test');
55
const localStorageGetItemMock = vi.spyOn(
66
window.localStorage.__proto__,
77
'getItem'
@@ -28,7 +28,7 @@ describe('isAdminModeStorage', () => {
2828
it('should return true when stored value is "true"', () => {
2929
localStorageGetItemMock.mockImplementationOnce(() => 'true');
3030

31-
const result = isAdminModeStorage.load();
31+
const result = testBooleanStorage.load();
3232

3333
expect(result).toBe(true);
3434
expect(localStorageGetItemMock).toHaveBeenCalledWith(KEY);
@@ -37,45 +37,45 @@ describe('isAdminModeStorage', () => {
3737
it('should return false when stored value is "false"', () => {
3838
localStorageGetItemMock.mockImplementationOnce(() => 'false');
3939

40-
const result = isAdminModeStorage.load();
40+
const result = testBooleanStorage.load();
4141

4242
expect(result).toBe(false);
4343
});
4444

4545
it('should return undefined when value is missing', () => {
4646
localStorageGetItemMock.mockImplementationOnce(() => null);
4747

48-
const result = isAdminModeStorage.load();
48+
const result = testBooleanStorage.load();
4949

5050
expect(result).toBeUndefined();
5151
});
5252

5353
it('should return undefined for an invalid value', () => {
5454
localStorageGetItemMock.mockImplementationOnce(() => 'garbage');
5555

56-
const result = isAdminModeStorage.load();
56+
const result = testBooleanStorage.load();
5757

5858
expect(result).toBeUndefined();
5959
});
6060
});
6161

6262
describe('save', () => {
6363
it('should store "true"', () => {
64-
isAdminModeStorage.save(true);
64+
testBooleanStorage.save(true);
6565

6666
expect(localStorageSetItemMock).toHaveBeenCalledWith(KEY, 'true');
6767
});
6868

6969
it('should store "false"', () => {
70-
isAdminModeStorage.save(false);
70+
testBooleanStorage.save(false);
7171

7272
expect(localStorageSetItemMock).toHaveBeenCalledWith(KEY, 'false');
7373
});
7474
});
7575

7676
describe('clear', () => {
7777
it('should remove the key from localStorage', () => {
78-
isAdminModeStorage.clear();
78+
testBooleanStorage.clear();
7979

8080
expect(localStorageRemoveItemMock).toHaveBeenCalledWith(KEY);
8181
});

0 commit comments

Comments
 (0)