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-03-20 11:32:51 -07:00
|
|
|
import hbs from 'htmlbars-inline-precompile';
|
2018-03-28 12:40:12 -07:00
|
|
|
import notificationsStub from 'wherehows-web/tests/stubs/services/notifications';
|
|
|
|
import userStub from 'wherehows-web/tests/stubs/services/current-user';
|
|
|
|
import sinon from 'sinon';
|
2018-03-20 11:32:51 -07:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
module('Integration | Component | datasets/containers/dataset acl access', function(hooks) {
|
|
|
|
setupRenderingTest(hooks);
|
2018-03-28 12:40:12 -07:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
hooks.beforeEach(function() {
|
|
|
|
this.owner.register('service:current-user', userStub);
|
|
|
|
this.owner.register('service:notifications', notificationsStub);
|
2018-03-28 12:40:12 -07:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
this['current-user'] = this.owner.lookup('service:current-user');
|
|
|
|
this.notifications = this.owner.lookup('service:notifications');
|
2018-03-28 12:40:12 -07:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
this.server = sinon.createFakeServer();
|
|
|
|
this.server.respondImmediately = true;
|
|
|
|
});
|
2018-03-28 12:40:12 -07:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
hooks.afterEach(function() {
|
|
|
|
this.server.restore();
|
|
|
|
});
|
2018-03-20 11:32:51 -07:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
test('it renders', async function(assert) {
|
|
|
|
this.server.respondWith('GET', /\/api\/v2\/datasets.*/, [
|
|
|
|
200,
|
|
|
|
{ 'Content-Type': 'application/json' },
|
|
|
|
JSON.stringify({})
|
|
|
|
]);
|
|
|
|
await render(hbs`{{datasets/containers/dataset-acl-access}}`);
|
2018-03-20 11:32:51 -07:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
assert.equal(
|
|
|
|
this.$()
|
|
|
|
.text()
|
|
|
|
.trim(),
|
|
|
|
'JIT ACL is not currently available for this dataset platform'
|
|
|
|
);
|
|
|
|
});
|
2018-03-20 11:32:51 -07:00
|
|
|
});
|