summaryrefslogtreecommitdiffhomepage
path: root/gui/test
diff options
context:
space:
mode:
Diffstat (limited to 'gui/test')
-rw-r--r--gui/test/e2e/mocked/tunnel-state.spec.ts6
-rw-r--r--gui/test/unit/auth-failure.spec.ts27
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);
- });
-});