Delete type column on hosts list within targets. Change test back to its initial state
This commit is contained in:
1 parent
6cec91b09b
commit
be20491d2e
2 files changed
+26
-42
No files matched your search
@@ -1,45 +1,36 @@
|
||||
{{page-title (t 'resources.host-set.title_plural')}}
|
||||
|
||||
{{#if @model.hosts}}
|
||||
|
||||
<Rose::Table as |table|>
|
||||
<table.body as |body|>
|
||||
{{#each @model.hosts as |host|}}
|
||||
{{#if host.isStatic}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
{{host.displayName}}
|
||||
<p>{{host.description}}</p>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@text={{host.id}}
|
||||
@buttonText={{t 'actions.copy-to-clipboard'}}
|
||||
@acknowledgeText={{t 'states.copied'}}
|
||||
>
|
||||
<code>{{host.id}}</code>
|
||||
</Copyable>
|
||||
</row.cell>
|
||||
<row.cell>{{host.attributes.address}}</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{t
|
||||
(concat 'resources.host.types.' host.type)
|
||||
}}</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Button
|
||||
@style='secondary'
|
||||
{{on 'click' (route-action 'connect' @model.target host)}}
|
||||
>
|
||||
{{t 'resources.session.actions.connect'}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/if}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
{{host.displayName}}
|
||||
<p>{{host.description}}</p>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@text={{host.id}}
|
||||
@buttonText={{t 'actions.copy-to-clipboard'}}
|
||||
@acknowledgeText={{t 'states.copied'}}
|
||||
>
|
||||
<code>{{host.id}}</code>
|
||||
</Copyable>
|
||||
</row.cell>
|
||||
<row.cell>{{host.attributes.address}}</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Button
|
||||
@style='secondary'
|
||||
{{on 'click' (route-action 'connect' @model.target host)}}
|
||||
>
|
||||
{{t 'resources.session.actions.connect'}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
|
||||
{{else}}
|
||||
|
||||
<Rose::Layout::Centered>
|
||||
|
||||
@@ -173,14 +173,7 @@ module('Acceptance | projects | targets | hosts', function (hooks) {
|
||||
|
||||
test('visiting index', async function (assert) {
|
||||
assert.expect(2);
|
||||
// Because we are generating host with different types but just showing on the list
|
||||
// the type = static, we have to apply a filter here
|
||||
const rawHostsList = this.server.schema.hosts.all();
|
||||
const filteredHostsList = rawHostsList.filter((host) => {
|
||||
if (host.type === 'static') {
|
||||
return host;
|
||||
}
|
||||
}).length;
|
||||
const hostsCount = this.server.schema.hosts.all().models.length;
|
||||
// This later/cancelTimers technique allows us to test a page with
|
||||
// active polling. Normally an acceptance test waits for all runloop timers
|
||||
// to stop before returning from an awaited test, but polling means that
|
||||
@@ -190,7 +183,7 @@ module('Acceptance | projects | targets | hosts', function (hooks) {
|
||||
run.cancelTimers();
|
||||
// await a11yAudit();
|
||||
assert.equal(currentURL(), urls.hosts);
|
||||
assert.equal(findAll('tbody tr').length, filteredHostsList);
|
||||
assert.equal(findAll('tbody tr').length, hostsCount);
|
||||
}, 750);
|
||||
await visit(urls.hosts);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user