fix: 🐛 show change cluster url when no auth methods (#2201)

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13133
This commit is contained in:
Cameron Perera authored and GitHub committed 2024-03-25 14:24:53 -05:00
1 parent 0c6744581d
commit ac1d98bbec
2 files changed
+17 -10

No files matched your search

@@ -46,22 +46,13 @@
{{#if @model.authMethods}}
{{outlet}}
<p class='change-origin'>
{{t 'cluster-url.connected-to'}}:
<code>{{this.clusterUrl}}</code>
<br />
<LinkTo @route='cluster-url'>
{{t 'actions.change-cluster-url'}}
</LinkTo>
</p>
{{/if}}
{{#unless @model.authMethods}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.auth-method.messages.none.title'}}
@icon='flight-icons/svg/alert-circle-16'
data-test-no-auth-methods
as |message|
>
<message.description>
@@ -70,5 +61,13 @@
</Rose::Message>
</Rose::Layout::Centered>
{{/unless}}
<p class='change-origin'>
{{t 'cluster-url.connected-to'}}:
<code>{{this.clusterUrl}}</code>
<br />
<LinkTo @route='cluster-url'>
{{t 'actions.change-cluster-url'}}
</LinkTo>
</p>
</BrandedCard>
</main>
@@ -259,4 +259,12 @@ module('Acceptance | authentication', function (hooks) {
assert.dom('.rose-dropdown-content a').exists({ count: 2 });
});
test('change cluster url is visible when no auth methods are available', async function (assert) {
this.server.get('/auth-methods', () => new Response(200));
await visit(urls.authenticate.methods.global);
assert.dom('[data-test-no-auth-methods]').includesText('No Auth Methods');
assert.dom('.change-origin').exists();
});
});