From 9bf03b0fba17b461f395a560c5ce6443865da567 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Wed, 22 Mar 2023 08:15:59 -0700 Subject: [PATCH] Add acceptance test for session-recordings/session-recording/channels-by-connection/channel --- .../channels-by-connection/channel-test.js | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 ui/admin/tests/acceptance/session-recordings/session-recording/channels-by-connection/channel-test.js diff --git a/ui/admin/tests/acceptance/session-recordings/session-recording/channels-by-connection/channel-test.js b/ui/admin/tests/acceptance/session-recordings/session-recording/channels-by-connection/channel-test.js new file mode 100644 index 000000000..a971cdb27 --- /dev/null +++ b/ui/admin/tests/acceptance/session-recordings/session-recording/channels-by-connection/channel-test.js @@ -0,0 +1,63 @@ +import { module, test } from 'qunit'; +import { visit, currentURL } from '@ember/test-helpers'; +import { setupApplicationTest } from 'admin/tests/helpers'; +import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { authenticateSession } from 'ember-simple-auth/test-support'; + +module( + 'Acceptance | session recordings | session recording | channels by connection | channel', + function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + + // Instances + const instances = { + scopes: { + global: null, + org: null, + }, + sessionRecording: null, + connectionRecording: null, + channelRecording: null, + }; + + // Urls + const urls = { + globalScope: null, + sessionRecordings: null, + sessionRecording: null, + }; + + hooks.beforeEach(function () { + instances.scopes.global = this.server.create('scope', { id: 'global' }); + instances.scopes.org = this.server.create('scope', { + type: 'org', + scope: { id: 'global', type: 'global' }, + }); + instances.sessionRecording = this.server.create('session-recording', { + scope: instances.scopes.global, + }); + instances.connectionRecording = this.server.create( + 'connection-recording', + { + session_recording: instances.sessionRecording, + } + ); + instances.channelRecording = this.server.create('channel-recording', { + connection_recording: instances.connectionRecording, + }); + urls.globalScope = `/scopes/global`; + urls.sessionRecordings = `${urls.globalScope}/session-recordings`; + urls.sessionRecording = `${urls.sessionRecordings}/${instances.sessionRecording.id}`; + urls.connectionRecording = `${urls.sessionRecording}/channels-by-connection/${instances.channelRecording.id}`; + authenticateSession({}); + }); + + test('user can navigate to a channel', async function (assert) { + assert.expect(1); + // Visit channel + await visit(urls.connectionRecording); + assert.strictEqual(currentURL(), urls.connectionRecording); + }); + } +);