diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2022-11-30 10:37:14 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-11-30 10:37:14 +0100 |
| commit | 4bf5b1c5df0776d18e7a31f40c0d840e508b4b22 (patch) | |
| tree | 86b0897032d465ec70b878ee336443171455cd4f /gui/test | |
| parent | d424bdbedeb1c8e44b693eac02d169e11b7ac92a (diff) | |
| parent | 4fe3a01bc392ee1392e23f424987a01733a9a57e (diff) | |
| download | mullvadvpn-4bf5b1c5df0776d18e7a31f40c0d840e508b4b22.tar.xz mullvadvpn-4bf5b1c5df0776d18e7a31f40c0d840e508b4b22.zip | |
Merge branch 'improve-tunnel-state-error-handling'
Diffstat (limited to 'gui/test')
| -rw-r--r-- | gui/test/e2e/mocked/tunnel-state.spec.ts | 6 | ||||
| -rw-r--r-- | gui/test/unit/auth-failure.spec.ts | 27 |
2 files changed, 3 insertions, 30 deletions
diff --git a/gui/test/e2e/mocked/tunnel-state.spec.ts b/gui/test/e2e/mocked/tunnel-state.spec.ts index c1f0317e24..77ee715103 100644 --- a/gui/test/e2e/mocked/tunnel-state.spec.ts +++ b/gui/test/e2e/mocked/tunnel-state.spec.ts @@ -2,9 +2,9 @@ import { expect, test } from '@playwright/test'; import { Page } from 'playwright'; import { colors } from '../../../src/config.json'; -import { ILocation, ITunnelEndpoint, TunnelState } from '../../../src/shared/daemon-rpc-types'; -import { getBackgroundColor, getColor } from '../utils'; import { startAppWithMocking, MockIpcHandle, SendMockIpcResponse } from './mocked-utils'; +import { ErrorStateCause, ILocation, ITunnelEndpoint, TunnelState } from '../../../src/shared/daemon-rpc-types'; +import { getBackgroundColor, getColor } from '../utils'; const UNSECURED_COLOR = colors.red; const SECURE_COLOR = colors.green; @@ -161,7 +161,7 @@ test('App should show error tunnel state', async () => { await sendMockIpcResponse<TunnelState>({ channel: 'tunnel-', - response: { state: 'error', details: { cause: { reason: 'is_offline' } } }, + response: { state: 'error', details: { cause: ErrorStateCause.isOffline } }, }); const statusLabel = getLabel(); diff --git a/gui/test/unit/auth-failure.spec.ts b/gui/test/unit/auth-failure.spec.ts deleted file mode 100644 index 61aa3bce61..0000000000 --- a/gui/test/unit/auth-failure.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { expect } from 'chai'; -import { it, describe } from 'mocha'; -import { parseAuthFailure, AuthFailureKind } from '../../src/shared/auth-failure'; - -describe('auth_failed parsing', () => { - it('invalid line parsing works', () => { - const authFailure = parseAuthFailure('invalid auth_failed message'); - expect(authFailure.kind).to.be.equal(AuthFailureKind.unknown); - expect(authFailure.message).to.be.equal('invalid auth_failed message'); - }); - - it('valid unknown works', () => { - const authFailure = parseAuthFailure('[valid_unknown] Message'); - expect(authFailure.kind).to.be.equal(AuthFailureKind.unknown); - expect(authFailure.message).to.be.equal('Message'); - }); - - it('valid known works', () => { - const authFailure = parseAuthFailure('[INVALID_ACCOUNT] Invalid account'); - expect(authFailure.kind).to.be.equal(AuthFailureKind.invalidAccount); - }); - - it('empty message works', () => { - const authFailure = parseAuthFailure('[INVALID_ACCOUNT]'); - expect(authFailure.kind).to.be.equal(AuthFailureKind.invalidAccount); - }); -}); |
