refactor: 💡 Add channel ability for asciicasts (#174)

This commit is contained in:
Zhihe Li authored and GitHub committed 2023-03-31 21:19:46 +00:00
1 parent 3bf2620b2c
commit 62ec3fe914
14 files changed
+1783 -860

No files matched your search

@@ -1,5 +1,6 @@
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);
@@ -9,4 +10,17 @@ module('Unit | Model | channel-recording', function (hooks) {
let model = store.createRecord('channel-recording', {});
assert.ok(model);
});
test('it has isAsciicast property and returns the expected values', async function (assert) {
assert.expect(2);
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);
});
});