-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: show region in header gutter when only one region exists
This PR adds a plain text label of the region to the header when there is only one region present. Before, nothing was showin in this case, and a dropdown was shown on federated clusters. The use case here is for operators of multiple non-federated Nomad clusters, when all the UI's involved otherwise look identical.
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render } from '@ember/test-helpers'; | ||
import { hbs } from 'ember-cli-htmlbars'; | ||
|
||
module('Unit | Component | region-switcher', function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('displays single region', async function (assert) { | ||
const system = { | ||
shouldShowRegions: false, | ||
}; | ||
|
||
this.set('system', system); | ||
|
||
await render(hbs`<RegionSwitcher/>`); | ||
|
||
assert.dom('.is-region').exists(); | ||
}); | ||
}); |