Files
threshold-ui/addons/api/tests/unit/models/channel-recording-test.js
T

39 lines
1.3 KiB
JavaScript
Raw Normal View History

import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
2023-03-16 13:49:04 -04:00
import { TYPE_CHANNEL_RECORDING_SESSION } from 'api/models/channel-recording';
2023-03-16 13:49:04 -04:00
module('Unit | Model | channel-recording', function (hooks) {
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('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');
2023-03-16 13:49:04 -04:00
const modelA = store.createRecord('channel-recording', {
type: TYPE_CHANNEL_RECORDING_SESSION,
});
2023-03-16 13:49:04 -04:00
const modelB = store.createRecord('channel-recording', {
type: 'no-such-type',
});
assert.false(modelA.isUnknown);
assert.true(modelB.isUnknown);
});
test('it has isSession property and returns the expected values', async function (assert) {
assert.expect(2);
const store = this.owner.lookup('service:store');
2023-03-16 13:49:04 -04:00
const modelA = store.createRecord('channel-recording', {
type: TYPE_CHANNEL_RECORDING_SESSION,
});
2023-03-16 13:49:04 -04:00
const modelB = store.createRecord('channel-recording', {
type: 'random',
});
assert.true(modelA.isSession);
assert.false(modelB.isSession);
});
});