Files
threshold-ui/addons/api/tests/unit/models/channel-recording-test.js
T
Lisbet Alvarez 3ba93927fe Update copyright headers (#3146)
* empty commit

* Add missing copyright headers

* chore: 🤖 update copywrite config file with correct year

* Add missing copyright headers

* empty commit (gh action merge checks are stuck)
2026-01-28 17:09:06 -08:00

43 lines
1.4 KiB
JavaScript

/**
* Copyright IBM Corp. 2021, 2026
* SPDX-License-Identifier: BUSL-1.1
*/
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { MIME_TYPE_ASCIICAST } from 'api/models/channel-recording';
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-recording', {});
assert.ok(model);
});
test('it has isAsciicast property and returns the expected values', async function (assert) {
const store = this.owner.lookup('service:store');
const modelA = store.createRecord('channel-recording', {
mime_types: [MIME_TYPE_ASCIICAST],
});
const modelB = store.createRecord('channel-recording', {
mime_types: ['random'],
});
assert.true(modelA.isAsciicast);
assert.false(modelB.isAsciicast);
});
test('it has isAsciicast property and returns the expected values when mime_types are not present', async function (assert) {
const store = this.owner.lookup('service:store');
const modelA = store.createRecord('channel-recording', {
mime_types: undefined,
});
const modelB = store.createRecord('channel-recording', {
mime_types: [],
});
assert.false(modelA.isAsciicast);
assert.false(modelB.isAsciicast);
});
});