feat: 🎸 user can update clusterURL when controller unsupported (#2113)

* feat: 🎸 user can update clusterURL when controller unsupported

* test: 💍 add cluster url tests
This commit is contained in:
Cameron Perera authored and GitHub committed 2024-01-26 11:33:40 -06:00
1 parent e76cc2eeeb
commit def6959ee7
4 files changed
+46 -1

No files matched your search

+1
View File
@@ -101,4 +101,5 @@ unsupported-controller:
buttons:
download: Download supported version
releases-page: Go to releases page
change-cluster-url: Change cluster URL
error: Unable to download supported version of desktop app. You’ll need to download version 1.7.1 from the releases page
+5
View File
@@ -690,3 +690,8 @@ $chevron-down: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231
display: grid;
gap: 1rem;
}
.unsupported-modal-footer {
display: flex;
gap: 1rem;
}
+8 -1
View File
@@ -39,7 +39,7 @@
{{t 'unsupported-controller.description.install'}}
</Hds::Text::Body>
</M.Body>
<M.Footer>
<M.Footer class='unsupported-modal-footer'>
<Hds::Button
type='button'
@text={{t 'unsupported-controller.buttons.download'}}
@@ -48,6 +48,13 @@
disabled={{unless this.downloadLink 'disabled'}}
data-test-download-link
/>
<Hds::Button
type='button'
@color='secondary'
@route='cluster-url'
@text={{t 'unsupported-controller.buttons.change-cluster-url'}}
data-test-change-cluster-url
/>
</M.Footer>
</Hds::Modal>
{{/unless}}
@@ -340,4 +340,36 @@ module('Acceptance | scopes', function (hooks) {
.dom('[data-test-releases-link]')
.hasAttribute('href', 'https://releases.hashicorp.com/boundary-desktop/');
});
test('pagination is not supported - navigate to cluster url page', async function (assert) {
invalidateSession();
this.stubClientDaemonSearch();
this.ipcStub.withArgs('checkOS').returns({
isWindows: true,
isMac: false,
isLinux: false,
});
this.server.get('/scopes', () => {
// no "list_token" field
return new Response(200, {}, { scopes: [] });
});
this.server.get('https://api.releases.hashicorp.com/*', () => {
return new Response(200, {}, META_DATA_RESPONSE);
});
await visit(urls.targets);
await waitFor('[data-test-unsupported-controller]');
assert.dom('[data-test-unsupported-controller]').exists();
assert
.dom('[data-test-download-link]')
.hasAttribute('href', 'windows.fake.download.zip');
assert
.dom('[data-test-change-cluster-url]')
.hasAttribute('href', '/cluster-url');
await click('[data-test-change-cluster-url]');
assert.strictEqual(currentURL(), urls.clusterUrl);
});
});