mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 20:39:08 +01:00
532a10f9f5
* Adding browser outdated notification * updating dependency * adding unit tests for util function * adding unit tests for selectors, lintfix * Added Tests, refactored notification delay logic * lint:fix * adding test coverage for method parameter * Update app/scripts/controllers/app-state.js adding documentation details Co-authored-by: Mark Stacey <markjstacey@gmail.com> * moving declaration into test * Update app/scripts/controllers/app-state.test.js spacing in test file Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Update jest.config.js removing duplicate entries Co-authored-by: Mark Stacey <markjstacey@gmail.com> * using async submitRequestToBackground method * removing unused import * removing unnecessary link syntax in notification * adding opera and edge and associated tests * handling the undefined case in bowser.satisfies * setOutdatedBrowserWarningLastShown try/catch * lint:fix * Removing try/catch and letting errors bubble up Removing deprecated displayWarning method Co-authored-by: Mark Stacey <markjstacey@gmail.com> * taking out forceMetamaskUpdateState call * excludint app-state test from mocha test suite * Added note: Jest files should match Mocha excluded * syntax error, lint:fix --------- Co-authored-by: Mark Stacey <markjstacey@gmail.com>
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);
|
|
});
|
|
});
|
|
});
|