2023-06-19 16:23:53 +00:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
2023-03-07 16:38:41 -05:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
|
import { setupTest } from 'ember-qunit';
|
|
|
|
|
|
2023-03-16 13:49:04 -04:00
|
|
|
module('Unit | Model | connection-recording', function (hooks) {
|
2023-03-07 16:38:41 -05:00
|
|
|
setupTest(hooks);
|
|
|
|
|
|
|
|
|
|
test('it exists', function (assert) {
|
|
|
|
|
let store = this.owner.lookup('service:store');
|
2023-03-16 13:49:04 -04:00
|
|
|
let model = store.createRecord('connection-recording', {});
|
2023-03-07 16:38:41 -05:00
|
|
|
assert.ok(model);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('it has channels as a relationship', async function (assert) {
|
|
|
|
|
const store = this.owner.lookup('service:store');
|
2023-03-16 13:49:04 -04:00
|
|
|
const model = store.createRecord('connection-recording', {
|
|
|
|
|
channel_recordings: [store.createRecord('channel-recording')],
|
2023-03-07 16:38:41 -05:00
|
|
|
});
|
|
|
|
|
|
2023-03-16 13:49:04 -04:00
|
|
|
const channel_recordings = await model.channel_recordings;
|
|
|
|
|
assert.strictEqual(channel_recordings.length, 1);
|
2023-03-07 16:38:41 -05:00
|
|
|
});
|
|
|
|
|
});
|