mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 17:35:43 +03:00
Some light topology acceptance tests
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxed-section">
|
||||
<div class="boxed-section-head">
|
||||
<div data-test-info-panel-title class="boxed-section-head">
|
||||
{{#if this.activeNode}}Client{{else if this.activeAllocation}}Allocation{{else}}Cluster{{/if}} Details
|
||||
</div>
|
||||
<div class="boxed-section-body">
|
||||
|
||||
53
ui/tests/acceptance/topology-test.js
Normal file
53
ui/tests/acceptance/topology-test.js
Normal file
@@ -0,0 +1,53 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupApplicationTest } from 'ember-qunit';
|
||||
import { setupMirage } from 'ember-cli-mirage/test-support';
|
||||
import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit';
|
||||
import Topology from 'nomad-ui/tests/pages/topology';
|
||||
|
||||
// TODO: Once we settle on the contents of the info panel, the contents
|
||||
// should also get acceptance tests.
|
||||
module('Acceptance | topology', function(hooks) {
|
||||
setupApplicationTest(hooks);
|
||||
setupMirage(hooks);
|
||||
|
||||
hooks.beforeEach(function() {
|
||||
server.create('job', { createAllocations: false });
|
||||
});
|
||||
|
||||
test('it passes an accessibility audit', async function(assert) {
|
||||
server.createList('node', 3);
|
||||
server.createList('allocation', 5);
|
||||
|
||||
await Topology.visit();
|
||||
await a11yAudit(assert);
|
||||
});
|
||||
|
||||
test('by default the info panel shows cluster aggregate stats', async function(assert) {
|
||||
server.createList('node', 3);
|
||||
server.createList('allocation', 5);
|
||||
|
||||
await Topology.visit();
|
||||
assert.equal(Topology.infoPanelTitle, 'Cluster Details');
|
||||
});
|
||||
|
||||
test('when an allocation is selected, the info panel shows information on the allocation', async function(assert) {
|
||||
server.createList('node', 1);
|
||||
server.createList('allocation', 5);
|
||||
|
||||
await Topology.visit();
|
||||
|
||||
await Topology.viz.datacenters[0].nodes[0].memoryRects[0].select();
|
||||
assert.equal(Topology.infoPanelTitle, 'Allocation Details');
|
||||
});
|
||||
|
||||
test('when a node is selected, the info panel shows information on the node', async function(assert) {
|
||||
// A high node count is required for node selection
|
||||
server.createList('node', 51);
|
||||
server.createList('allocation', 5);
|
||||
|
||||
await Topology.visit();
|
||||
|
||||
await Topology.viz.datacenters[0].nodes[0].selectNode();
|
||||
assert.equal(Topology.infoPanelTitle, 'Client Details');
|
||||
});
|
||||
});
|
||||
11
ui/tests/pages/topology.js
Normal file
11
ui/tests/pages/topology.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import { create, text, visitable } from 'ember-cli-page-object';
|
||||
|
||||
import TopoViz from 'nomad-ui/tests/pages/components/topo-viz';
|
||||
|
||||
export default create({
|
||||
visit: visitable('/topology'),
|
||||
|
||||
infoPanelTitle: text('[data-test-info-panel-title]'),
|
||||
|
||||
viz: TopoViz('[data-test-topo-viz]'),
|
||||
});
|
||||
Reference in New Issue
Block a user