2018-08-09 10:41:52 -07:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
|
|
import { render } from '@ember/test-helpers';
|
2018-02-21 09:46:04 -08:00
|
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
|
|
import { waitUntil, find } from 'ember-native-dom-helpers';
|
|
|
|
import { urn } from 'wherehows-web/mirage/fixtures/urn';
|
2018-02-25 20:34:38 -08:00
|
|
|
import sinon from 'sinon';
|
2018-02-21 09:46:04 -08:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
module('Integration | Component | datasets/containers/dataset properties', function(hooks) {
|
|
|
|
setupRenderingTest(hooks);
|
2018-02-21 09:46:04 -08:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
hooks.beforeEach(function() {
|
|
|
|
this.server = sinon.createFakeServer();
|
|
|
|
this.server.respondImmediately = true;
|
|
|
|
});
|
2018-02-21 09:46:04 -08:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
hooks.afterEach(function() {
|
|
|
|
this.server.restore();
|
|
|
|
});
|
2018-02-21 09:46:04 -08:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
test('it renders', async function(assert) {
|
|
|
|
const labelClass = '.dataset-deprecation-toggle__toggle-header__label';
|
|
|
|
this.set('urn', urn);
|
|
|
|
this.server.respondWith('GET', /\/api\/v2\/datasets.*/, [
|
|
|
|
200,
|
|
|
|
{ 'Content-Type': 'application/json' },
|
|
|
|
JSON.stringify({})
|
|
|
|
]);
|
2018-02-21 09:46:04 -08:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
await render(hbs`{{datasets/containers/dataset-properties urn=urn}}`);
|
2018-02-21 09:46:04 -08:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
assert.ok(find(labelClass), 'renders presentation component');
|
|
|
|
});
|
2018-02-21 09:46:04 -08:00
|
|
|
});
|