Skip to content

Commit

Permalink
remove use of rsvp
Browse files Browse the repository at this point in the history
  • Loading branch information
amk221 committed Dec 18, 2023
1 parent 70f2980 commit ab3457a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions addon/components/modal-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock';
import { action } from '@ember/object';
import { waitFor } from '@ember/test-waiters';
import { waitForAnimation } from '@zestia/animation-utils';
import { all } from 'rsvp';

export default class ModalDialogComponent extends Component {
@tracked isInViewport;
Expand Down Expand Up @@ -223,7 +222,7 @@ export default class ModalDialogComponent extends Component {

@waitFor
_waitForAnimation() {
return all([
return Promise.all([
waitForAnimation(this.element, { maybe: true }),
waitForAnimation(this.boxElement, { maybe: true })
]);
Expand Down
1 change: 0 additions & 1 deletion tests/dummy/app/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { Promise } from 'rsvp';
import { action } from '@ember/object';
import { later } from '@ember/runloop';

Expand Down
6 changes: 3 additions & 3 deletions tests/integration/components/modal-dialog-test.gjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import waitForAnimation from 'dummy/tests/helpers/wait-for-animation';
import { reject, resolve, defer } from 'rsvp';
import { defer } from 'rsvp';
import { modifier } from 'ember-modifier';
import ModalDialog from '@zestia/ember-modal-dialog/components/modal-dialog';
import autoFocus from '@zestia/ember-auto-focus/modifiers/auto-focus';
Expand Down Expand Up @@ -343,7 +343,7 @@ module('modal-dialog', function (hooks) {
@tracked error;
})();

const load = () => reject({ message: 'sorry' });
const load = () => Promise.reject(new Error('sorry'));
const loadError = (error) => (state.error = error);

await render(<template>
Expand Down Expand Up @@ -373,7 +373,7 @@ module('modal-dialog', function (hooks) {
};

const handleReady = () => {};
const load = () => resolve();
const load = () => Promise.resolve();

await render(<template>
<ModalDialog @onReady={{handleReady}} @onLoad={{load}} />
Expand Down

0 comments on commit ab3457a

Please sign in to comment.