Chore/update model names (#125)

* chore: 🤖 Rename recording to session-recording

* chore: 🤖 Update names for connection models

* chore: 🤖 Update channel models to new name

* chore: 🤖 Update remaining models after merge conflict
This commit is contained in:
Zhihe Li authored and GitHub committed 2023-03-16 13:49:04 -04:00
1 parent 24f50b3e2d
commit d08ce29e5a
46 files changed
+442 -372

No files matched your search

@@ -1,23 +1,23 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { TYPE_CHANNEL_SESSION } from 'api/models/channel';
import { TYPE_CHANNEL_RECORDING_SESSION } from 'api/models/channel-recording';
module('Unit | Model | channel', function (hooks) {
module('Unit | Model | channel-recording', function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('channel', {});
let model = store.createRecord('channel-recording', {});
assert.ok(model);
});
test('it has isUnknown property and returns the expected values', async function (assert) {
assert.expect(2);
const store = this.owner.lookup('service:store');
const modelA = store.createRecord('channel', {
type: TYPE_CHANNEL_SESSION,
const modelA = store.createRecord('channel-recording', {
type: TYPE_CHANNEL_RECORDING_SESSION,
});
const modelB = store.createRecord('channel', {
const modelB = store.createRecord('channel-recording', {
type: 'no-such-type',
});
assert.false(modelA.isUnknown);
@@ -27,10 +27,10 @@ module('Unit | Model | channel', function (hooks) {
test('it has isSession property and returns the expected values', async function (assert) {
assert.expect(2);
const store = this.owner.lookup('service:store');
const modelA = store.createRecord('channel', {
type: TYPE_CHANNEL_SESSION,
const modelA = store.createRecord('channel-recording', {
type: TYPE_CHANNEL_RECORDING_SESSION,
});
const modelB = store.createRecord('channel', {
const modelB = store.createRecord('channel-recording', {
type: 'random',
});
assert.true(modelA.isSession);
@@ -1,23 +1,23 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Model | connection', function (hooks) {
module('Unit | Model | connection-recording', function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('connection', {});
let model = store.createRecord('connection-recording', {});
assert.ok(model);
});
test('it has channels as a relationship', async function (assert) {
assert.expect(1);
const store = this.owner.lookup('service:store');
const model = store.createRecord('connection', {
channels: [store.createRecord('channel')],
const model = store.createRecord('connection-recording', {
channel_recordings: [store.createRecord('channel-recording')],
});
const channels = await model.channels;
assert.strictEqual(channels.length, 1);
const channel_recordings = await model.channel_recordings;
assert.strictEqual(channel_recordings.length, 1);
});
});
@@ -1,25 +1,25 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { TYPE_RECORDING_SSH } from 'api/models/recording';
import { TYPE_SESSION_RECORDING_SSH } from 'api/models/session-recording';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
module('Unit | Model | recording', function (hooks) {
module('Unit | Model | session-recording', function (hooks) {
setupTest(hooks);
setupMirage(hooks);
test('it exists', function (assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('recording', {});
let model = store.createRecord('session-recording', {});
assert.ok(model);
});
test('it has isUnknown property and returns the expected values', async function (assert) {
assert.expect(2);
const store = this.owner.lookup('service:store');
const modelA = store.createRecord('recording', {
type: TYPE_RECORDING_SSH,
const modelA = store.createRecord('session-recording', {
type: TYPE_SESSION_RECORDING_SSH,
});
const modelB = store.createRecord('recording', {
const modelB = store.createRecord('session-recording', {
type: 'no-such-type',
});
assert.false(modelA.isUnknown);
@@ -29,10 +29,10 @@ module('Unit | Model | recording', function (hooks) {
test('it has isSSH property and returns the expected values', async function (assert) {
assert.expect(2);
const store = this.owner.lookup('service:store');
const modelA = store.createRecord('recording', {
type: TYPE_RECORDING_SSH,
const modelA = store.createRecord('session-recording', {
type: TYPE_SESSION_RECORDING_SSH,
});
const modelB = store.createRecord('recording', {
const modelB = store.createRecord('session-recording', {
type: 'random',
});
assert.true(modelA.isSSH);
@@ -42,12 +42,12 @@ module('Unit | Model | recording', function (hooks) {
test('it has connections as a relationship', async function (assert) {
assert.expect(1);
const store = this.owner.lookup('service:store');
const model = store.createRecord('recording', {
type: TYPE_RECORDING_SSH,
connections: [store.createRecord('connection')],
const model = store.createRecord('session-recording', {
type: TYPE_SESSION_RECORDING_SSH,
connection_recordings: [store.createRecord('connection-recording')],
});
const connections = await model.connections;
assert.strictEqual(connections.length, 1);
const connection_recordings = await model.connection_recordings;
assert.strictEqual(connection_recordings.length, 1);
});
});