Move toasts to subdirectory
This commit is contained in:
parent
e11ed97287
commit
d2b110ab84
10 changed files with 59 additions and 35 deletions
|
|
@ -1,3 +0,0 @@
|
|||
import Component from '@glimmer/component';
|
||||
|
||||
export default class SuccessToastComponent extends Component {}
|
||||
3
app/components/toast/success.js
Normal file
3
app/components/toast/success.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import Component from '@glimmer/component';
|
||||
|
||||
export default class ToastSuccessComponent extends Component {}
|
||||
|
|
@ -4,10 +4,10 @@ import { action } from '@ember/object';
|
|||
import { inject as service } from '@ember/service';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import { Loading, Check, AlertOctagonOutline } from 'ember-mdi';
|
||||
import Task from '../models/task';
|
||||
import Task from 'meiliadmin/models/task';
|
||||
|
||||
// TODO: refactor for using more inside Task logic
|
||||
export default class TaskToastComponent extends Component {
|
||||
export default class ToastTaskComponent extends Component {
|
||||
@service meilisearch;
|
||||
|
||||
@tracked task;
|
||||
|
|
@ -2,8 +2,8 @@ import Service from '@ember/service';
|
|||
import { tracked } from '@glimmer/tracking';
|
||||
import { hbs } from 'ember-template-imports';
|
||||
import { action } from '@ember/object';
|
||||
import SuccessToast from '../components/success-toast';
|
||||
import TaskToast from '../components/task-toast';
|
||||
import SuccessToast from '../components/toast/success';
|
||||
import TaskToast from '../components/toast/task';
|
||||
|
||||
export default class ToasterService extends Service {
|
||||
@tracked container = [];
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'meiliadmin/tests/helpers';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | success-toast', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
// test('it renders', async function (assert) {
|
||||
// await render(hbs`<SuccessToast />`);
|
||||
|
||||
// assert.dom(this.element).hasText('');
|
||||
// });
|
||||
});
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'meiliadmin/tests/helpers';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | task-toast', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
// test('it renders', async function (assert) {
|
||||
// await render(hbs`<TaskToast />`);
|
||||
|
||||
// assert.dom(this.element).hasText('');
|
||||
// });
|
||||
});
|
||||
26
tests/integration/components/toast/success-test.js
Normal file
26
tests/integration/components/toast/success-test.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'meiliadmin/tests/helpers';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | toast/success', 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`<Toast::Success />`);
|
||||
|
||||
assert.dom(this.element).hasText('');
|
||||
|
||||
// Template block usage:
|
||||
await render(hbs`
|
||||
<Toast::Success>
|
||||
template block text
|
||||
</Toast::Success>
|
||||
`);
|
||||
|
||||
assert.dom(this.element).hasText('template block text');
|
||||
});
|
||||
});
|
||||
26
tests/integration/components/toast/task-test.js
Normal file
26
tests/integration/components/toast/task-test.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'meiliadmin/tests/helpers';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | toast/task', 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`<Toast::Task />`);
|
||||
|
||||
assert.dom(this.element).hasText('');
|
||||
|
||||
// Template block usage:
|
||||
await render(hbs`
|
||||
<Toast::Task>
|
||||
template block text
|
||||
</Toast::Task>
|
||||
`);
|
||||
|
||||
assert.dom(this.element).hasText('template block text');
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue