mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 14:15:06 +01:00
34 lines
947 B
JavaScript
34 lines
947 B
JavaScript
|
import AppStateController from './app-state';
|
||
|
|
||
|
describe('AppStateController', () => {
|
||
|
describe('setOutdatedBrowserWarningLastShown', () => {
|
||
|
it('should set the last shown time', () => {
|
||
|
const appStateController = new AppStateController({
|
||
|
addUnlockListener: jest.fn(),
|
||
|
isUnlocked: jest.fn(() => true),
|
||
|
initState: {},
|
||
|
onInactiveTimeout: jest.fn(),
|
||
|
showUnlockRequest: jest.fn(),
|
||
|
preferencesStore: {
|
||
|
subscribe: jest.fn(),
|
||
|
getState: jest.fn(() => ({
|
||
|
preferences: {
|
||
|
autoLockTimeLimit: 0,
|
||
|
},
|
||
|
})),
|
||
|
},
|
||
|
qrHardwareStore: {
|
||
|
subscribe: jest.fn(),
|
||
|
},
|
||
|
});
|
||
|
const date = new Date();
|
||
|
|
||
|
appStateController.setOutdatedBrowserWarningLastShown(date);
|
||
|
|
||
|
expect(
|
||
|
appStateController.store.getState().outdatedBrowserWarningLastShown,
|
||
|
).toStrictEqual(date);
|
||
|
});
|
||
|
});
|
||
|
});
|