chore: Add empty acceptance test case for hosts

This commit is contained in:
Susmitha Girumala committed 2020-08-20 15:51:35 -04:00
1 parent fc75b1df9e
commit cb6048aca7
3 files changed
+32 -88

No files matched your search

+9 -62
View File
@@ -1,79 +1,26 @@
import { module, test } from 'qunit';
import { visit, currentURL } from '@ember/test-helpers';
// import { visit, currentURL } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import a11yAudit from 'ember-a11y-testing/test-support/audit';
import {
authenticateSession,
// These are left here intentionally for future reference.
//currentSession,
//invalidateSession,
} from 'ember-simple-auth/test-support';
// import a11yAudit from 'ember-a11y-testing/test-support/audit';
// import {
// authenticateSession,
// // These are left here intentionally for future reference.
// //currentSession,
// //invalidateSession,
// } from 'ember-simple-auth/test-support';
module('Acceptance | hosts', function (hooks) {
setupApplicationTest(hooks);
setupMirage(hooks);
const instances = {
scopes: {
global: null,
org: null,
project: null,
hostCatalog: null
},
host: null
};
const urls = {
orgScope: null,
projects: null,
project: null,
hostCatalogs: null,
hostCatalog: null,
hosts: null
};
hooks.beforeEach(function () {
// Setup Mirage mock resources for this test
instances.scopes.global = this.server.create('scope', { id: 'global' });
instances.scopes.org = this.server.create('scope', { type: 'org',
scope: { id: instances.scopes.global.id, type: instances.scopes.global.type }
});
instances.scopes.project = this.server.create('scope', { type: 'project',
scope: { id: instances.scopes.org.id, type: instances.scopes.org.type }
});
instances.scopes.hostCatalog = this.server.create('host', {
scope: {
id: instances.scopes.project.id,
type: instances.scopes.project.type
}
});
instances.host = this.server.create('host', {
scope: {
id: instances.scopes.project.id,
type: instances.scopes.project.type
},
hostCatalog: {
id: instances.scopes.hostCatalog.id,
type: instances.scopes.hostCatalog.type
}
});
// Generate route URLs for resources
urls.orgScope = `/scopes/${instances.scopes.org.id}`;
urls.projects = `${urls.orgScope}/projects`;
urls.project = `${urls.projects}/${instances.scopes.hostCatalog.scope.id}`;
urls.hostCatalogs = `${urls.project}/host-catalogs`;
urls.hostCatalog = `${urls.hostCatalogs}/${instances.scopes.hostCatalog.id}`;
urls.hosts = `${urls.hostCatalog}/host`;
});
test('visiting host', async function (assert) {
assert.expect(1);
authenticateSession();
await visit(urls.hosts);
await a11yAudit();
assert.equal(currentURL(), urls.hosts);
assert.expect(0);
});
test('can navigate to a host form', async function (assert) {
@@ -0,0 +1,23 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, find } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | form/host', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
this.submit = () => {};
this.cancel = () => {};
await render(hbs`
<Form::Host
@submit={{this.submit}}
@cancel={{this.cancel}}
/>`);
assert.ok(find('form'));
});
});
@@ -1,26 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | form/host/index', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Form::Host::Index />`);
assert.equal(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
<Form::Host::Index>
template block text
</Form::Host::Index>
`);
assert.equal(this.element.textContent.trim(), 'template block text');
});
});