diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-12-08 12:46:42 -0200 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-12-11 12:38:23 -0200 |
| commit | 22bb2777d95b79242f92c3ea06b72f087849e7d8 (patch) | |
| tree | 2c27af9b30e2eb7a5c83910f215e76700929dd8d /gui/packages/desktop/test/components | |
| parent | 6cc5b2badae95ed840bfad3c1ba3a17efa82608a (diff) | |
| download | mullvadvpn-22bb2777d95b79242f92c3ea06b72f087849e7d8.tar.xz mullvadvpn-22bb2777d95b79242f92c3ea06b72f087849e7d8.zip | |
Implement warning when little account time remains
Diffstat (limited to 'gui/packages/desktop/test/components')
| -rw-r--r-- | gui/packages/desktop/test/components/NotificationArea.spec.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gui/packages/desktop/test/components/NotificationArea.spec.js b/gui/packages/desktop/test/components/NotificationArea.spec.js index bdd001e8ab..08639e36ff 100644 --- a/gui/packages/desktop/test/components/NotificationArea.spec.js +++ b/gui/packages/desktop/test/components/NotificationArea.spec.js @@ -3,6 +3,7 @@ import * as React from 'react'; import { shallow } from 'enzyme'; import NotificationArea from '../../src/renderer/components/NotificationArea'; +import AccountExpiry from '../../src/renderer/lib/account-expiry'; describe('components/NotificationArea', () => { const defaultVersion = { @@ -15,6 +16,12 @@ describe('components/NotificationArea', () => { nextUpgrade: null, }; + const defaultExpiry = new AccountExpiry( + moment() + .add(1, 'year') + .format(), + ); + it('handles disconnecting state', () => { for (const reason of ['nothing', 'block', 'reconnect']) { const component = shallow( @@ -24,6 +31,7 @@ describe('components/NotificationArea', () => { details: { reason }, }} version={defaultVersion} + accountExpiry={defaultExpiry} />, ); expect(component.state('visible')).to.be.false; @@ -38,6 +46,7 @@ describe('components/NotificationArea', () => { state, }} version={defaultVersion} + accountExpiry={defaultExpiry} />, ); @@ -52,6 +61,7 @@ describe('components/NotificationArea', () => { state: 'connecting', }} version={defaultVersion} + accountExpiry={defaultExpiry} />, ); @@ -69,6 +79,7 @@ describe('components/NotificationArea', () => { }, }} version={defaultVersion} + accountExpiry={defaultExpiry} />, ); @@ -86,6 +97,7 @@ describe('components/NotificationArea', () => { ...defaultVersion, consistent: false, }} + accountExpiry={defaultExpiry} />, ); @@ -106,6 +118,7 @@ describe('components/NotificationArea', () => { current: '2018.1', nextUpgrade: '2018.2', }} + accountExpiry={defaultExpiry} />, ); @@ -127,6 +140,7 @@ describe('components/NotificationArea', () => { latestStable: '2018.3', nextUpgrade: '2018.3', }} + accountExpiry={defaultExpiry} />, ); @@ -149,6 +163,7 @@ describe('components/NotificationArea', () => { latestStable: '2018.3', nextUpgrade: '2018.4-beta3', }} + accountExpiry={defaultExpiry} />, ); |
