@@ -4,11 +4,20 @@ import { render, click, focus, triggerKeyEvent } from '@ember/test-helpers';
44import { hbs } from 'ember-cli-htmlbars' ;
55import { run , later } from '@ember/runloop' ;
66import RSVP from 'rsvp' ;
7- import require from 'require' ;
8- import { importSync } from '@embroider/macros' ;
7+ import {
8+ dependencySatisfies ,
9+ macroCondition ,
10+ importSync ,
11+ } from '@embroider/macros' ;
912import ownProp from 'test-app/utils/own-prop' ;
1013
11- const dateLibrary = require . has ( 'luxon' ) ? 'luxon' : 'moment' ;
14+ let dateLibrary = '' ;
15+
16+ if ( macroCondition ( dependencySatisfies ( 'moment' , '*' ) ) ) {
17+ dateLibrary = 'moment' ;
18+ } else if ( macroCondition ( dependencySatisfies ( 'luxon' , '*' ) ) ) {
19+ dateLibrary = 'luxon' ;
20+ }
1221
1322module ( 'Integration | Component | <PowerCalendar>' , function ( hooks ) {
1423 setupRenderingTest ( hooks ) ;
@@ -1138,8 +1147,8 @@ module('Integration | Component | <PowerCalendar>', function (hooks) {
11381147
11391148 test ( 'user can provide `@tag` attribute' , async function ( assert ) {
11401149 assert . expect ( 1 ) ;
1141- await render ( hbs `
1142- <PowerCalendar @tag="li" />
1150+ await render ( hbs `
1151+ <PowerCalendar @tag="li" />
11431152 ` ) ;
11441153 assert
11451154 . dom ( 'li.ember-power-calendar' )
@@ -1148,8 +1157,8 @@ module('Integration | Component | <PowerCalendar>', function (hooks) {
11481157
11491158 test ( 'user can provide empty `@tag` attribute' , async function ( assert ) {
11501159 assert . expect ( 1 ) ;
1151- await render ( hbs `
1152- <PowerCalendar @tag="" />
1160+ await render ( hbs `
1161+ <PowerCalendar @tag="" />
11531162 ` ) ;
11541163 assert
11551164 . dom ( '.ember-power-calendar' )
0 commit comments