@@ -269,12 +269,18 @@ describe('CouponForm', () => {
269
269
expect ( element . hiddenSelector . matches ( 'coupon-codes' , true ) ) . to . be . true ;
270
270
expect ( element . hiddenSelector . matches ( 'category-restrictions' , true ) ) . to . be . true ;
271
271
expect ( element . hiddenSelector . matches ( 'attributes' , true ) ) . to . be . true ;
272
+ expect ( element . hiddenSelector . matches ( 'coupon-codes-stub' , true ) ) . to . be . false ;
273
+ expect ( element . hiddenSelector . matches ( 'category-restrictions-stub' , true ) ) . to . be . false ;
274
+ expect ( element . hiddenSelector . matches ( 'attributes-stub' , true ) ) . to . be . false ;
272
275
273
276
element . data = await getTestData ( './hapi/coupons/0' ) ;
274
277
275
278
expect ( element . hiddenSelector . matches ( 'coupon-codes' , true ) ) . to . be . false ;
276
279
expect ( element . hiddenSelector . matches ( 'category-restrictions' , true ) ) . to . be . false ;
277
280
expect ( element . hiddenSelector . matches ( 'attributes' , true ) ) . to . be . false ;
281
+ expect ( element . hiddenSelector . matches ( 'coupon-codes-stub' , true ) ) . to . be . true ;
282
+ expect ( element . hiddenSelector . matches ( 'category-restrictions-stub' , true ) ) . to . be . true ;
283
+ expect ( element . hiddenSelector . matches ( 'attributes-stub' , true ) ) . to . be . true ;
278
284
} ) ;
279
285
280
286
it ( 'renders a form header' , ( ) => {
@@ -363,10 +369,15 @@ describe('CouponForm', () => {
363
369
</ foxy-coupon-form >
364
370
` ) ;
365
371
372
+ const controlStub = element . renderRoot . querySelector (
373
+ 'foxy-internal-summary-control[infer="coupon-codes-stub"] foxy-i18n[infer=""][key="text"]'
374
+ ) ;
375
+
366
376
const control = element . renderRoot . querySelector (
367
377
'foxy-internal-async-list-control[infer=coupon-codes]'
368
378
) as InternalAsyncListControl ;
369
379
380
+ expect ( controlStub ) . to . exist ;
370
381
expect ( control ) . to . exist ;
371
382
372
383
expect ( control ) . to . have . attribute (
@@ -460,7 +471,12 @@ describe('CouponForm', () => {
460
471
'foxy-internal-async-resource-link-list-control[infer=category-restrictions]'
461
472
) ;
462
473
474
+ const controlStub = element . renderRoot . querySelector (
475
+ 'foxy-internal-summary-control[infer="category-restrictions-stub"] foxy-i18n[infer=""][key="text"]'
476
+ ) ;
477
+
463
478
expect ( control ) . to . exist ;
479
+ expect ( controlStub ) . to . exist ;
464
480
await waitUntil ( ( ) => ! ! control ?. hasAttribute ( 'options-href' ) ) ;
465
481
466
482
expect ( control ) . to . have . attribute ( 'foreign-key-for-uri' , 'item_category_uri' ) ;
@@ -683,7 +699,12 @@ describe('CouponForm', () => {
683
699
'foxy-internal-async-list-control[infer=attributes]'
684
700
) as InternalAsyncListControl ;
685
701
702
+ const controlStub = element . renderRoot . querySelector (
703
+ 'foxy-internal-summary-control[infer="category-restrictions-stub"] foxy-i18n[infer=""][key="text"]'
704
+ ) ;
705
+
686
706
expect ( control ) . to . exist ;
707
+ expect ( controlStub ) . to . exist ;
687
708
expect ( control ) . to . have . attribute (
688
709
'first' ,
689
710
'https://demo.api/hapi/coupon_attributes?coupon_id=0'
0 commit comments