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

@@ -202,68 +202,4 @@ module('Unit | Abilities | session-recording', function (hooks) {
)
);
});
test('can download asciicast when an ssh recording has download authorization', function (assert) {
assert.expect(2);
const recordingWithAuthorizedAction = store.createRecord(
'session-recording',
{
authorized_actions: ['download'],
type: TYPE_SESSION_RECORDING_SSH,
}
);
const recordingWithoutAuthorizedAction = store.createRecord(
'session-recording',
{
authorized_actions: [],
type: TYPE_SESSION_RECORDING_SSH,
}
);
assert.true(
canService.can(
'downloadAsciiCast session-recording',
recordingWithAuthorizedAction
)
);
assert.false(
canService.can(
'downloadAsciiCast session-recording',
recordingWithoutAuthorizedAction
)
);
});
test('cannot download asciicast when a recording is not ssh type', function (assert) {
assert.expect(2);
const recordingWithAuthorizedAction = store.createRecord(
'session-recording',
{
authorized_actions: ['download'],
type: 'unknown',
}
);
const recordingWithoutAuthorizedAction = store.createRecord(
'session-recording',
{
authorized_actions: [],
type: 'unknown',
}
);
assert.false(
canService.can(
'downloadAsciiCast session-recording',
recordingWithAuthorizedAction
)
);
assert.false(
canService.can(
'downloadAsciiCast session-recording',
recordingWithoutAuthorizedAction
)
);
});
});