Skip to content

Commit d9a76a3

Browse files
committed
fix tests
1 parent 21c1355 commit d9a76a3

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

apps/demo/src/app/cart/components/cart-item/cart-item.component.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
} from '@daffodil/cart/state/testing';
1818
import { DaffCartItemFactory } from '@daffodil/cart/testing';
1919
import { DAFF_FORM_FIELD_COMPONENTS } from '@daffodil/design/form-field';
20-
import { DaffQuantityFieldComponent } from '@daffodil/design/quantity-field';
2120
import { DaffProductImageFactory } from '@daffodil/product/testing';
2221
import { DaffSfQuantityFieldComponent } from '@daffodil/storefront/quantity-field';
2322

@@ -49,7 +48,6 @@ describe('CartItemComponent', () => {
4948
DaffCartStateTestingModule,
5049
ReactiveFormsModule,
5150
DAFF_FORM_FIELD_COMPONENTS,
52-
DaffQuantityFieldComponent,
5351
CartItemComponent,
5452
WrapperComponent,
5553
],
@@ -69,10 +67,9 @@ describe('CartItemComponent', () => {
6967
mockCartItem = cartItemFactory.create({ image: productImageFactory.create() });
7068

7169
wrapper.cartItemValue = mockCartItem;
70+
fixture.detectChanges();
7271
cartItemComponent = fixture.debugElement.query(By.css('demo-cart-item'));
7372
quantityFieldComponent = fixture.debugElement.query(By.css('daff-sf-quantity-field')).componentInstance;
74-
75-
fixture.detectChanges();
7673
});
7774

7875
it('should create', () => {

apps/demo/src/app/cart/components/cart-item/cart-item.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
DaffBase64ServiceToken,
2222
} from '@daffodil/core';
2323
import { DAFF_FORM_FIELD_COMPONENTS } from '@daffodil/design/form-field';
24-
import { DaffQuantityFieldComponent } from '@daffodil/design/quantity-field';
24+
import { DaffSfQuantityFieldComponent } from '@daffodil/storefront/quantity-field';
2525

2626
@Component({
2727
selector: 'demo-cart-item',
@@ -30,7 +30,7 @@ import { DaffQuantityFieldComponent } from '@daffodil/design/quantity-field';
3030
imports: [
3131
ReactiveFormsModule,
3232
DAFF_FORM_FIELD_COMPONENTS,
33-
DaffQuantityFieldComponent,
33+
DaffSfQuantityFieldComponent,
3434
],
3535
})
3636
export class CartItemComponent implements OnInit {

apps/demo/src/app/cart/components/cart-items/cart-items.component.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
} from '@daffodil/cart/testing';
2121

2222
import { CartItemsComponent } from './cart-items.component';
23+
import { CartItemComponent } from '../cart-item/cart-item.component';
2324

2425
@Component({
2526
template: '<demo-cart-items [cart]="cartValue"></demo-cart-items>',
@@ -55,8 +56,12 @@ describe('CartItemsComponent', () => {
5556
providers: [
5657
provideMockStore({}),
5758
],
58-
})
59-
.compileComponents();
59+
});
60+
TestBed.overrideComponent(CartItemsComponent, {
61+
remove: { imports: [CartItemComponent]},
62+
add: { imports: [MockCartItemComponent]},
63+
});
64+
TestBed.compileComponents();
6065
}));
6166

6267
beforeEach(() => {

0 commit comments

Comments
 (0)