summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-12-11 12:17:34 -0200
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-12-11 12:38:23 -0200
commit5e4dd00b277e9cb6641dc21f3f489ba862644207 (patch)
tree96b05ca5a50e580717bd8812251ef3cd9fe29a64
parentddc3fa93d456ada63f0d6df05941efaac05da846 (diff)
downloadmullvadvpn-5e4dd00b277e9cb6641dc21f3f489ba862644207.tar.xz
mullvadvpn-5e4dd00b277e9cb6641dc21f3f489ba862644207.zip
Test `NotificationArea` with time running low
-rw-r--r--gui/packages/desktop/test/components/NotificationArea.spec.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/gui/packages/desktop/test/components/NotificationArea.spec.js b/gui/packages/desktop/test/components/NotificationArea.spec.js
index 08639e36ff..f661aa9f12 100644
--- a/gui/packages/desktop/test/components/NotificationArea.spec.js
+++ b/gui/packages/desktop/test/components/NotificationArea.spec.js
@@ -1,5 +1,6 @@
// @flow
+import moment from 'moment';
import * as React from 'react';
import { shallow } from 'enzyme';
import NotificationArea from '../../src/renderer/components/NotificationArea';
@@ -171,4 +172,24 @@ describe('components/NotificationArea', () => {
expect(component.state('upgradeVersion')).to.be.equal('2018.4-beta3');
expect(component.state('visible')).to.be.true;
});
+
+ it('handles time running low', () => {
+ const expiry = new AccountExpiry(
+ moment()
+ .add(2, 'days')
+ .format(),
+ );
+ const component = shallow(
+ <NotificationArea
+ tunnelState={{
+ state: 'disconnected',
+ }}
+ version={defaultVersion}
+ accountExpiry={expiry}
+ />,
+ );
+
+ expect(component.state('type')).to.be.equal('expires-soon');
+ expect(component.state('visible')).to.be.true;
+ });
});