Skip to content

Commit ca4b299

Browse files
committed
test(feature): fixed all the failing tests
1 parent 87e9b4b commit ca4b299

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/app/shared/components/badges/badges.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { initContext, TestContext } from '../../../../testing/test.context';
44

55
@Component({
66
template: `
7-
<ff4j-badges [values]="values" [maxToShow]="maxToShow"></ff4j-badges>
7+
<ff4j-badges [values]="values" [maxToShow]="maxToShow"></ff4j-badges>
88
`
99
})
1010
class TesteeBadgeComponent {
@@ -29,7 +29,7 @@ describe('BadgesComponent', () => {
2929
// on change should apply
3030
this.hostComponent.values = ['4', '5'];
3131
this.hostComponent.maxToShow = 2;
32-
this.detectChanges();
32+
this.fixture.detectChanges();
3333
expect(this.testedComponent.values).toEqual(['4', '5']);
3434
expect(this.testedComponent.maxToShow).toEqual(2);
3535
});

src/app/shared/components/feature-card/feature-card.component.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Property } from '../../models/Property';
77

88
@Component({
99
template: `
10-
<ff4j-feature-card [feature]="feature"></ff4j-feature-card>
10+
<ff4j-feature-card [feature]="feature"></ff4j-feature-card>
1111
`
1212
})
1313
class TesteeFeatureCardComponent {
@@ -30,7 +30,7 @@ describe('FeatureCardComponent', () => {
3030
initContext(FeatureCardComponent, TesteeFeatureCardComponent, moduleMetaData);
3131

3232
it('should create', function(this: Context) {
33-
this.detectChanges();
33+
this.fixture.detectChanges();
3434
expect(this.hostComponent).toBeTruthy();
3535
expect(this.testedComponent).toBeTruthy();
3636
});
@@ -41,15 +41,15 @@ describe('FeatureCardComponent', () => {
4141
});
4242

4343
it('should have got the input value for feature', function(this: Context) {
44-
this.detectChanges();
44+
this.fixture.detectChanges();
4545
expect(this.testedComponent.feature.uid).toBe('Feature_UID');
4646
expect(this.testedComponent.feature.description).toBe(`Feature Card Description`);
4747
expect(this.testedComponent.feature.group).toBe('Group Name');
4848
expect(this.testedComponent.feature.enable).toBeFalsy();
4949
expect(this.testedComponent.feature.permissions.length).toEqual(4);
5050
// on change should apply
5151
this.hostComponent.feature.enable = true;
52-
this.detectChanges();
52+
this.fixture.detectChanges();
5353
expect(this.testedComponent.feature.enable).toBeTruthy();
5454
});
5555

@@ -63,7 +63,7 @@ describe('FeatureCardComponent', () => {
6363
value: 'go!',
6464
fixedValues: []
6565
});
66-
this.detectChanges();
66+
this.fixture.detectChanges();
6767
let resultValues = this.testedComponent.getPropertiesValues(properties);
6868
expect(resultValues).toEqual(['SampleProperty = go!']);
6969
// if customProperties is undefined or empty it should also result in empty

0 commit comments

Comments
 (0)