Skip to content

Commit

Permalink
Reactivate importSync (necessary for tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkszepp committed Nov 27, 2023
1 parent 3357f1b commit 3694651
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ember-basic-dropdown/src/components/basic-dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { schedule } from '@ember/runloop';
import {
macroCondition,
isTesting,
// importSync,
importSync,
} from '@embroider/macros';
declare const FastBoot: any;
import config from 'ember-get-config';
Expand Down Expand Up @@ -326,15 +326,15 @@ export default class BasicDropdown extends Component<Args> {
_getDestinationId(): string {
// This takes care of stripping this code out if not running tests
if (macroCondition(isTesting())) {
// if (typeof FastBoot === 'undefined') {
// try {
// let { getRootElement } = importSync('@ember/test-helpers') as any;
if (typeof FastBoot === 'undefined') {
try {
let { getRootElement } = importSync('@ember/test-helpers') as any;

// return getRootElement().id;
// } catch (error) {
// // use default below
// }
// }
return getRootElement().id;
} catch (error) {
// use default below
}
}

let rootView = document.querySelector('#ember-testing > .ember-view');
if (rootView) {
Expand Down

0 comments on commit 3694651

Please sign in to comment.