Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module('Integration | Helper | foo/bar-baz', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
test('it renders', async function(assert) {
this.set('inputValue', '1234');
await render(hbs`{{foo/bar-baz inputValue}}`);
assert.equal(this.element.textContent.trim(), '1234');
});
});
module('Integration | Component | x-foo', 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``);
assert.equal(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
template block text
`);
module('Integration | Helper | lookup-action-type', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
test('it returns the expected action type', async function(assert) {
this.set('inputValue', 'ZM');
await render(hbs`{{lookup-action-type inputValue}}`);
assert.equal(this.element.textContent.trim(), '(ULURP) A Zoning Map Amendment is a change in designation or a change in district boundaries for any zoning district on the New York City Zoning Map. Zoning Map Amendments are discretionary actions subject to the Uniform Land Use Review Procedure.');
});
});
module('Integration | Component | base layer', function(hooks) {
setupRenderingTest(hooks);
test('using any layer without the createLayer implemented throws', function(assert) {
assert.expect(1);
this.set('center', locations.nyc);
this.set('zoom', 13);
assert.throws(async () => {
await render(hbs`
{{#leaflet-map zoom=zoom center=center}}
{{base-layer}}
{{/leaflet-map}}`);
}, /Assertion Failed: BaseLayer's `createLayer` should be overriden./);
});
test('using any layer outside a content layer throws', function(assert) {
module(name, function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
setProperties(this, london);
let testContext = this;
let waiterFulfilled = false;
this.owner.register('component:g-map', GMapComponent.extend({
init() {
this._super(...arguments);
registerWaiter(() => {
if (this._componentsInitialized === true) {
if (!waiterFulfilled) {
let { id, components, map } = this.publicAPI;
setProperties(testContext, { id, components, map });
module('Integration | Component | chart language', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
this.actions = {};
this.send = (actionName, ...args) => this.actions[actionName].apply(this, args);
});
test('Setting language', async function(assert) {
assert.expect(1);
const done = assert.async();
this.setProperties({
data,
options: {
hAxis: { format: 'MMMM' },
},
module('Integration | Component | base focusable', function(hooks) {
setupRenderingTest(hooks);
test('should set and remove disabled attribute', async function(assert) {
this.set('value', true);
await render(hbs`{{base-focusable id="base-focusable" disabled=value}}`);
assert.equal(this.$('#base-focusable').attr('disabled').trim(), 'disabled');
this.set('value', false);
assert.ok(!this.$('md-checkbox').attr('disabled'));
});
});
export function setupEngineRenderingTest(hooks: any, engine: string) {
setupRenderingTest(hooks, { resolver: engineResolverFor(engine) });
setupEngineFixtures(hooks);
}
export function setupRenderingTest(hooks: NestedHooks, options?: SetupTestOptions) {
emberQunitSetupRenderingTest(hooks, options);
injectCustomAssertions(hooks);
}
export function setupCardTest(hooks) {
setupRenderingTest(hooks);
setupCardTestComponent(hooks);
setupURLs(hooks);
}