summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-06-19 19:31:28 +0300
committerAndrej Mihajlov <and@codeispoetry.ru>2017-06-22 14:10:06 +0300
commit7432e0bc60d6462e65ef34fac3669a66fbe75538 (patch)
treecba0dc372e90bf4fe584347fd4e9b175ee6a12d8 /test
parent6add95b14cc72edd0c90a6b4f9b02f39105f2941 (diff)
downloadmullvadvpn-7432e0bc60d6462e65ef34fac3669a66fbe75538.tar.xz
mullvadvpn-7432e0bc60d6462e65ef34fac3669a66fbe75538.zip
Drop unused Enum class
Diffstat (limited to 'test')
-rw-r--r--test/enum.spec.js40
1 files changed, 0 insertions, 40 deletions
diff --git a/test/enum.spec.js b/test/enum.spec.js
deleted file mode 100644
index 013fbc4e0f..0000000000
--- a/test/enum.spec.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import { expect } from 'chai';
-import Enum from '../app/lib/enum';
-
-describe('enum', () => {
- it('should be able to compare values', () => {
- const e = new Enum('NORTH', 'SOUTH', 'WEST', 'EAST');
- expect(e.NORTH).to.be.equal('NORTH');
- });
-
- it('should not be able to modify enum', () => {
- const e = new Enum('NORTH', 'SOUTH', 'WEST', 'EAST');
- expect(() => e.ANYWHERE = 'ANYWHERE').to.throw();
- });
-
- it('should be able to validate enum keys', () => {
- const e = new Enum('NORTH', 'SOUTH', 'WEST', 'EAST');
- expect(e.isValid('SOUTH')).to.be.true;
- expect(e.isValid('ANYWHERE')).to.be.false;
- expect(e.isValid()).to.be.false;
- expect(e.isValid(null)).to.be.false;
- });
-
- it('should receive correct keys from Object.keys', () => {
- const keys = ['NORTH', 'SOUTH', 'WEST', 'EAST'];
- const e = new Enum(...keys);
- expect(Object.keys(e)).to.be.deep.equal(keys);
- });
-
- it('should do reverse lookup', () => {
- const keys = { NORTH: 0, SOUTH: 1, WEST: 2, EAST: 3 };
- const e = new Enum(keys);
- expect(e.reverse(2)).to.be.equal('WEST');
- });
-
- it('should return undefined on reverse lookup failure', () => {
- const keys = { NORTH: 0, SOUTH: 1, WEST: 2, EAST: 3 };
- const e = new Enum(keys);
- expect(e.reverse(1337)).to.be.undefined;
- });
-});