diff --git a/ui/packages/consul-ui/app/components/consul/datacenter/selector/index.hbs b/ui/packages/consul-ui/app/components/consul/datacenter/selector/index.hbs
index 97194bf298..f54b4606bf 100644
--- a/ui/packages/consul-ui/app/components/consul/datacenter/selector/index.hbs
+++ b/ui/packages/consul-ui/app/components/consul/datacenter/selector/index.hbs
@@ -2,49 +2,60 @@
class="dcs"
data-test-datacenter-menu
>
-
-
- {{@dc.Name}}
-
-
-
-
- {{#each menu.items as |item|}}
-
-
+
+ {{@dc.Name}}
+
+
+
+
+ Datacenters shown in this dropdown are available through WAN Federation.
+
+
+
+ DATACENTERS
+
+ {{#each menu.items as |item|}}
+
- {{item.Name}}
- {{#if item.Primary}}
- Primary
- {{/if}}
- {{#if item.Local}}
- Local
- {{/if}}
-
-
- {{/each}}
-
-
-
+
+ {{item.Name}}
+ {{#if item.Primary}}
+ Primary
+ {{/if}}
+ {{#if item.Local}}
+ Local
+ {{/if}}
+
+
+ {{/each}}
+
+
+
+ {{else}}
+ {{@dcs.firstObject.Name}}
+ {{/if}}
diff --git a/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs b/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs
index 07296d4fe1..4d7a040ff9 100644
--- a/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs
+++ b/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs
@@ -87,12 +87,12 @@
<:main-nav>
-
+
ul > [role='separator'] {
margin-top: 0.7rem;
padding-bottom: 0;
}
diff --git a/ui/packages/consul-ui/tests/integration/components/consul/datacenter/selector-test.js b/ui/packages/consul-ui/tests/integration/components/consul/datacenter/selector-test.js
new file mode 100644
index 0000000000..1a42372ced
--- /dev/null
+++ b/ui/packages/consul-ui/tests/integration/components/consul/datacenter/selector-test.js
@@ -0,0 +1,49 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from 'ember-qunit';
+import hbs from 'htmlbars-inline-precompile';
+import { render } from '@ember/test-helpers';
+
+module('Integration | Component | consul datacenter selector', function(hooks) {
+ setupRenderingTest(hooks);
+
+ test('it does not display a dropdown when only one dc is available', async function(assert) {
+ const dcs = [
+ {
+ Name: 'dc-1',
+ },
+ ];
+ this.set('dcs', dcs);
+ this.set('dc', dcs[0]);
+
+ await render(hbs``);
+
+ assert
+ .dom('[data-test-datacenter-disclosure-menu]')
+ .doesNotExist('datacenter dropdown is not displayed in nav');
+
+ assert
+ .dom('[data-test-datacenter-single]')
+ .hasText('dc-1', 'Datecenter name is displayed in nav');
+ });
+
+ test('it does displays a dropdown when more than one dc is available', async function(assert) {
+ const dcs = [
+ {
+ Name: 'dc-1',
+ },
+ {
+ Name: 'dc-2',
+ },
+ ];
+ this.set('dcs', dcs);
+ this.set('dc', dcs[0]);
+
+ await render(hbs``);
+
+ assert
+ .dom('[data-test-datacenter-single]')
+ .doesNotExist('we are displaying more than just the name of the first dc');
+
+ assert.dom('[data-test-datacenter-disclosure-menu]').exists('datacenter dropdown is displayed');
+ });
+});
diff --git a/ui/packages/consul-ui/tests/integration/components/hashicorp-consul-test.js b/ui/packages/consul-ui/tests/integration/components/hashicorp-consul-test.js
index 2f611c5522..58a75c94be 100644
--- a/ui/packages/consul-ui/tests/integration/components/hashicorp-consul-test.js
+++ b/ui/packages/consul-ui/tests/integration/components/hashicorp-consul-test.js
@@ -1,6 +1,7 @@
-import { module, skip } from 'qunit';
+import { module, skip, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
+import { render } from '@ember/test-helpers';
module('Integration | Component | hashicorp consul', function(hooks) {
setupRenderingTest(hooks);