Fix feature flag session recording target (#187)

* chore: 🤖 wrap target session recording with feature flag

* fix: 🐛 test

* fix: 🐛 test

* fix: 🐛 use ember truth helper
This commit is contained in:
Dharini Jeeva authored and GitHub committed 2023-04-04 12:20:45 -07:00
1 parent 639d57f927
commit 2c93c378c4
2 files changed
+17 -2

No files matched your search

@@ -30,8 +30,12 @@
@cancel={{route-action 'cancel' @model}}
/>
</sb.Body>
{{#if (can 'setStorageBucket target' @model)}}
{{#if
(and
(can 'setStorageBucket target' @model)
(feature-flag 'session-recording')
)
}}
<sb.Sidebar>
<div class='target-sidebar'>
<div class='title-wrapper'>
@@ -195,7 +195,17 @@ module('Acceptance | targets | read', function (hooks) {
.exists();
});
test('cannot enable session recording for a target without proper authorization', async function (assert) {
assert.expect(2);
assert.false(featuresService.isEnabled('session-recording'));
await visit(urls.sshTarget);
assert.dom('.target-sidebar a').doesNotExist();
});
test('users can click on enable-recording button in target session-recording sidebar and it takes them to enable session recording', async function (assert) {
featuresService.enable('session-recording');
assert.expect(1);
await visit(urls.sshTarget);
@@ -205,6 +215,7 @@ module('Acceptance | targets | read', function (hooks) {
});
test('users can click on settings icon in target session-recording sidebar and it takes them to enable session recording', async function (assert) {
featuresService.enable('session-recording');
assert.expect(1);
await visit(urls.sshTarget);