summaryrefslogtreecommitdiffhomepage
path: root/gui/test
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2023-10-31 15:24:22 +0100
committerDavid Lönnhager <david.l@mullvad.net>2023-10-31 15:24:22 +0100
commitf073ef8c37ecc4a0cd3d4525ed3bc310cfd2f7e0 (patch)
treef817e43aa5b924bf1b56aeb03e941913fa35e339 /gui/test
parent9b33f4440fd35d01eea663df5de7d83f65d96918 (diff)
parent3cedaf529da04bbd25fee4829fad4cc0ae2f561f (diff)
downloadmullvadvpn-f073ef8c37ecc4a0cd3d4525ed3bc310cfd2f7e0.tar.xz
mullvadvpn-f073ef8c37ecc4a0cd3d4525ed3bc310cfd2f7e0.zip
Merge branch 'refactor-relay-settings-update' into main
Diffstat (limited to 'gui/test')
-rw-r--r--gui/test/unit/relay-settings-builder.spec.ts99
1 files changed, 0 insertions, 99 deletions
diff --git a/gui/test/unit/relay-settings-builder.spec.ts b/gui/test/unit/relay-settings-builder.spec.ts
deleted file mode 100644
index eeba0828b7..0000000000
--- a/gui/test/unit/relay-settings-builder.spec.ts
+++ /dev/null
@@ -1,99 +0,0 @@
-import { expect } from 'chai';
-import { it, describe } from 'mocha';
-import RelaySettingsBuilder from '../../src/shared/relay-settings-builder';
-
-describe('Relay settings builder', () => {
- it('should set location to any', () => {
- expect(RelaySettingsBuilder.normal().location.any().build()).to.deep.equal({
- normal: {
- location: 'any',
- },
- });
- });
-
- it('should bound location to city', () => {
- expect(RelaySettingsBuilder.normal().location.city('se', 'mma').build()).to.deep.equal({
- normal: {
- location: {
- only: {
- country: 'se', city: 'mma',
- },
- },
- },
- });
- });
-
- it('should bound location to country', () => {
- expect(RelaySettingsBuilder.normal().location.country('se').build()).to.deep.equal({
- normal: {
- location: {
- only: { country: 'se' },
- },
- },
- });
- });
-
- it('should set openvpn settings to any', () => {
- expect(
- RelaySettingsBuilder.normal()
- .tunnel.openvpn((openvpn) => {
- openvpn.port.any().protocol.any();
- })
- .build(),
- ).to.deep.equal({
- normal: {
- openvpnConstraints: {
- port: 'any',
- protocol: 'any',
- },
- },
- });
- });
-
- it('should set openvpn settings to exact values', () => {
- expect(
- RelaySettingsBuilder.normal()
- .tunnel.openvpn((openvpn) => {
- openvpn.port.exact(80).protocol.exact('tcp');
- })
- .build(),
- ).to.deep.equal({
- normal: {
- openvpnConstraints: {
- port: { only: 80 },
- protocol: { only: 'tcp' },
- },
- },
- });
- });
-
- it('should set location from raw RelayLocation', () => {
- expect(RelaySettingsBuilder.normal().location.fromRaw('any').build()).to.deep.equal({
- normal: {
- location: 'any',
- },
- });
-
- expect(RelaySettingsBuilder.normal().location.fromRaw({ country: 'se' }).build()).to.deep.equal(
- {
- normal: {
- location: {
- only: { country: 'se' },
- },
- },
- },
- );
-
- expect(
- RelaySettingsBuilder.normal()
- .location.fromRaw({ country: 'se', city: 'mma' })
- .build(),
- ).to.deep.equal({
- normal: {
- location: {
- only: { country: 'se', city: 'mma' },
- },
- },
- });
- });
-});