Skip to content

Commit

Permalink
Fix ts errors in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josemarluedke committed Aug 19, 2020
1 parent 706794f commit 8a16af8
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ import hbs from 'htmlbars-inline-precompile';
import validateFormat from 'ember-changeset-validations/validators/format';
import validatePresence from 'ember-changeset-validations/validators/presence';

interface Model {
name: {
first: string;
last: string;
};
email: string;
}

declare module 'ember-test-helpers' {
interface TestContext {
model: Model;
}
}

module('Integration | Component | ChangesetForm', function (hooks) {
setupRenderingTest(hooks);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import { click, render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { Changeset } from 'ember-changeset';
import { run } from '@ember/runloop';
import { BufferedChangeset } from 'ember-changeset/types';

declare module 'ember-test-helpers' {
interface TestContext {
changeset: BufferedChangeset;
}
}

module(
'Integration | Component | ChangesetForm::Fields::CheckboxGroup',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import { render, click, find } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import 'qunit-dom';

declare module 'ember-test-helpers' {
interface TestContext {
myValue: unknown;
value: unknown;
myInputValue: unknown;
}
}

module('Integration | Component | FormCheckbox', function (hooks) {
setupRenderingTest(hooks);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import { setupRenderingTest } from 'ember-qunit';
import { render, click, triggerEvent } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { Notification, NotificationsService } from '@frontile/notifications';

declare module 'ember-test-helpers' {
interface TestContext {
notification?: Notification;
}
}

import sinon from 'sinon';

module('Integration | Component | NotificationCard', function (hooks) {
Expand All @@ -15,6 +22,7 @@ module('Integration | Component | NotificationCard', function (hooks) {
/>`;

test('it renders the notification content & close button', async function (assert) {
this;
this.set('notification', new Notification('My message'));

await render(template);
Expand Down Expand Up @@ -164,7 +172,8 @@ module('Integration | Component | NotificationCard', function (hooks) {
new Notification('My message', { transitionDuration: 1 })
);

this.notification.timer = {
// @ts-ignore
this.notification!.timer = {
pause() {
assert.ok('should have paused');
},
Expand Down

0 comments on commit 8a16af8

Please sign in to comment.