Skip to content

Commit

Permalink
ci: enable jest all (#5593)
Browse files Browse the repository at this point in the history
Co-authored-by: taiga-family-bot <[email protected]>
  • Loading branch information
splincode and taiga-family-bot authored Oct 11, 2023
1 parent 6360ab3 commit 1c09206
Show file tree
Hide file tree
Showing 86 changed files with 495 additions and 511 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"@taiga-ui/browserslist-config": "0.2.0",
"@taiga-ui/commitlint-config": "0.2.1",
"@taiga-ui/cspell-config": "0.15.0",
"@taiga-ui/eslint-plugin-experience": "0.9.1",
"@taiga-ui/eslint-plugin-experience": "0.10.2",
"@taiga-ui/prettier-config": "0.3.1",
"@taiga-ui/stylelint-config": "0.5.1",
"@testing-library/cypress": "9.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ describe(`InputCardGrouped`, () => {
beforeEach(() => setCard(`4111 1111 1111 1111`));

it(`input-card-grouped have a default icon`, () => {
expect(testComponent.control.valid).toEqual(true);
expect(testComponent.component.defaultIcon).toEqual(`tuiIconVisaMono`);
expect(testComponent.component.icon).toEqual(`tuiIconVisaMono`);
expect(testComponent.control.valid).toBe(true);
expect(testComponent.component.defaultIcon).toBe(`tuiIconVisaMono`);
expect(testComponent.component.icon).toBe(`tuiIconVisaMono`);
expect(testComponent.control.value).toEqual({card: `4111 1111 1111 1111`});

expect(expectCardOutlet()).toBeFalsy();
Expand All @@ -225,9 +225,9 @@ describe(`InputCardGrouped`, () => {
it(`input-card-grouped have tuiIconMastercard icon`, () => {
testComponent.component.cardSrc = `tuiIconMastercard`;

expect(testComponent.control.valid).toEqual(true);
expect(testComponent.component.defaultIcon).toEqual(`tuiIconVisaMono`);
expect(testComponent.component.icon).toEqual(`tuiIconMastercard`);
expect(testComponent.control.valid).toBe(true);
expect(testComponent.component.defaultIcon).toBe(`tuiIconVisaMono`);
expect(testComponent.component.icon).toBe(`tuiIconMastercard`);
expect(testComponent.control.value).toEqual({card: `4111 1111 1111 1111`});

expect(expectCardOutlet()).toBeFalsy();
Expand All @@ -239,8 +239,8 @@ describe(`InputCardGrouped`, () => {
testComponent.component.cardSrc =
fixture.componentInstance.customIconTemplate;

expect(testComponent.control.valid).toEqual(true);
expect(testComponent.component.defaultIcon).toEqual(`tuiIconVisaMono`);
expect(testComponent.control.valid).toBe(true);
expect(testComponent.component.defaultIcon).toBe(`tuiIconVisaMono`);
expect(testComponent.component.icon).toBeInstanceOf(TemplateRef);
expect(testComponent.control.value).toEqual({card: `4111 1111 1111 1111`});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,25 @@ describe(`InputCard`, () => {
it(`enabled`, () => {
testComponent.component.autocompleteEnabled = true;

expect(testComponent.component.autocompleteCard).toEqual(`cc-number`);
expect(testComponent.component.autocompleteCard).toBe(`cc-number`);
});

it(`disabled`, () => {
testComponent.component.autocompleteEnabled = false;

expect(testComponent.component.autocompleteCard).toEqual(`off`);
expect(testComponent.component.autocompleteCard).toBe(`off`);
});
});

describe(`focusable`, () => {
it(`touched`, () => {
testComponent.component.onFocused(true);

expect(testComponent.component.control?.touched).toEqual(false);
expect(testComponent.component.control?.touched).toBe(false);

testComponent.component.onFocused(false);

expect(testComponent.component.control?.touched).toEqual(true);
expect(testComponent.component.control?.touched).toBe(true);
});
});

Expand All @@ -88,8 +88,8 @@ describe(`InputCard`, () => {
testComponent.component.onValueChange(`1234 5678 1111 2222`);

expect(testComponent.onBinChange).toHaveBeenCalledWith(`123456`);
expect(testComponent.component.value).toEqual(`1234567811112222`);
expect(testComponent.component.bin).toEqual(`123456`);
expect(testComponent.component.value).toBe(`1234567811112222`);
expect(testComponent.component.bin).toBe(`123456`);

testComponent.component.onValueChange(`2222 4444 5555 6666`);
expect(testComponent.onBinChange).toHaveBeenCalledTimes(2);
Expand Down Expand Up @@ -205,24 +205,24 @@ describe(`InputCard`, () => {
beforeEach(() => testComponent.control.setValue(`4111 1111 1111 1111`));

it(`input-card component has a default icon`, () => {
expect(testComponent.control.valid).toEqual(true);
expect(testComponent.component.icon).toEqual(`tuiIconVisaMono`);
expect(testComponent.control.value).toEqual(`4111 1111 1111 1111`);
expect(testComponent.control.valid).toBe(true);
expect(testComponent.component.icon).toBe(`tuiIconVisaMono`);
expect(testComponent.control.value).toBe(`4111 1111 1111 1111`);
});

it(`input-card component has a tuiIconElectron icon`, () => {
testComponent.component.cardSrc = `tuiIconElectron`;
expect(testComponent.control.valid).toEqual(true);
expect(testComponent.component.icon).toEqual(`tuiIconElectron`);
expect(testComponent.control.value).toEqual(`4111 1111 1111 1111`);
expect(testComponent.control.valid).toBe(true);
expect(testComponent.component.icon).toBe(`tuiIconElectron`);
expect(testComponent.control.value).toBe(`4111 1111 1111 1111`);
});

it(`input-card component has an icon source as TemplateRef`, () => {
testComponent.component.cardSrc =
fixture.componentInstance.customIconTemplateRef;
expect(testComponent.control.valid).toEqual(true);
expect(testComponent.control.valid).toBe(true);
expect(testComponent.component.icon).toBeInstanceOf(TemplateRef);
expect(testComponent.control.value).toEqual(`4111 1111 1111 1111`);
expect(testComponent.control.value).toBe(`4111 1111 1111 1111`);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ describe(`TuiIntegerPart`, () => {
decimalLimit: 2,
});

expect(pipe.transform(10123.123)).toEqual(`10 123`);
expect(pipe.transform(10123)).toEqual(`10 123`);
expect(pipe.transform(null as unknown as number)).toEqual(`0`);
expect(pipe.transform(undefined as unknown as number)).toEqual(`NaN`);
expect(pipe.transform(`` as unknown as number)).toEqual(`0`);
expect(pipe.transform(`10,5` as unknown as number)).toEqual(`NaN`);
expect(pipe.transform(`10.5` as unknown as number)).toEqual(`10`);
expect(pipe.transform(10123.123)).toBe(`10 123`);
expect(pipe.transform(10123)).toBe(`10 123`);
expect(pipe.transform(null as unknown as number)).toBe(`0`);
expect(pipe.transform(undefined as unknown as number)).toBe(`NaN`);
expect(pipe.transform(`` as unknown as number)).toBe(`0`);
expect(pipe.transform(`10,5` as unknown as number)).toBe(`NaN`);
expect(pipe.transform(`10.5` as unknown as number)).toBe(`10`);
});

describe(`Config with rounding`, () => {
Expand All @@ -25,9 +25,9 @@ describe(`TuiIntegerPart`, () => {
rounding: `round`,
});

expect(pipe.transform(2004.87)).toEqual(`2 004`);
expect(pipe.transform(1000.87)).toEqual(`1 000`);
expect(pipe.transform(100.99, 1)).toEqual(`101`);
expect(pipe.transform(2004.87)).toBe(`2 004`);
expect(pipe.transform(1000.87)).toBe(`1 000`);
expect(pipe.transform(100.99, 1)).toBe(`101`);
});

it(`ceil`, () => {
Expand All @@ -36,9 +36,9 @@ describe(`TuiIntegerPart`, () => {
rounding: `ceil`,
});

expect(pipe.transform(2004.87)).toEqual(`2 004`);
expect(pipe.transform(1000.87)).toEqual(`1 000`);
expect(pipe.transform(100.99, 1)).toEqual(`101`);
expect(pipe.transform(2004.87)).toBe(`2 004`);
expect(pipe.transform(1000.87)).toBe(`1 000`);
expect(pipe.transform(100.99, 1)).toBe(`101`);
});

it(`floor`, () => {
Expand All @@ -47,9 +47,9 @@ describe(`TuiIntegerPart`, () => {
rounding: `floor`,
});

expect(pipe.transform(2004.87)).toEqual(`2 004`);
expect(pipe.transform(1000.87)).toEqual(`1 000`);
expect(pipe.transform(100.99, 1)).toEqual(`100`);
expect(pipe.transform(2004.87)).toBe(`2 004`);
expect(pipe.transform(1000.87)).toBe(`1 000`);
expect(pipe.transform(100.99, 1)).toBe(`100`);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ describe(`Money component options`, () => {
});

it(`override by custom options`, () => {
expect(testComponent.component.currency).toEqual(`EUR`);
expect(testComponent.component.sign).toEqual(`never`);
expect(testComponent.component.singleColor).toEqual(false);
expect(testComponent.component.precision).toEqual(1);
expect(testComponent.component.colored).toEqual(false);
expect(testComponent.component.red).toEqual(false);
expect(testComponent.component.signSymbol).toEqual(``);
expect(testComponent.component.currency).toBe(`EUR`);
expect(testComponent.component.sign).toBe(`never`);
expect(testComponent.component.singleColor).toBe(false);
expect(testComponent.component.precision).toBe(1);
expect(testComponent.component.colored).toBe(false);
expect(testComponent.component.red).toBe(false);
expect(testComponent.component.signSymbol).toBe(``);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe(`Money`, () => {
`${testContext.prefix}currency`,
);

expect(currency?.nativeElement.textContent?.trim()).toEqual(``);
expect(currency?.nativeElement.textContent?.trim()).toBe(``);
});

it(`if empty string is passed, currency symbol is not shown`, () => {
Expand All @@ -79,7 +79,7 @@ describe(`Money`, () => {
`${testContext.prefix}currency`,
);

expect(currency?.nativeElement.textContent?.trim()).toEqual(``);
expect(currency?.nativeElement.textContent?.trim()).toBe(``);
});

it(`words with currency code`, () => {
Expand All @@ -90,7 +90,7 @@ describe(`Money`, () => {
`${testContext.prefix}currency`,
);

expect(currency?.nativeElement.textContent?.trim()).toEqual(`$`);
expect(currency?.nativeElement.textContent?.trim()).toBe(`$`);
});

it(`works with currency name`, () => {
Expand All @@ -101,7 +101,7 @@ describe(`Money`, () => {
`${testContext.prefix}currency`,
);

expect(currency?.nativeElement.textContent?.trim()).toEqual(`$`);
expect(currency?.nativeElement.textContent?.trim()).toBe(`$`);
});

it(`works with custom currency`, () => {
Expand All @@ -124,7 +124,7 @@ describe(`Money`, () => {
`${testContext.prefix}fraction-part`,
);

expect(fraction?.nativeElement.textContent).toEqual(``);
expect(fraction?.nativeElement.textContent).toBe(``);
});

it(`non zero decimals a padded with zeroes by default`, () => {
Expand All @@ -135,7 +135,7 @@ describe(`Money`, () => {
`${testContext.prefix}fraction-part`,
);

expect(fraction?.nativeElement.textContent).toEqual(`,10`);
expect(fraction?.nativeElement.textContent).toBe(`,10`);
});

it(`truncating float values`, () => {
Expand All @@ -154,7 +154,7 @@ describe(`Money`, () => {
tuiReplaceNbsp(
`${integer?.nativeElement.textContent}${fraction?.nativeElement.textContent}`,
),
).toEqual(`23 724,99`);
).toBe(`23 724,99`);
});

it(`decimals only show 2 digits`, () => {
Expand All @@ -165,7 +165,7 @@ describe(`Money`, () => {
`${testContext.prefix}fraction-part`,
);

expect(fraction?.nativeElement.textContent).toEqual(`,12`);
expect(fraction?.nativeElement.textContent).toBe(`,12`);
});

it(`if ALWAYS is set, zero decimals are shown`, () => {
Expand All @@ -176,7 +176,7 @@ describe(`Money`, () => {
`${testContext.prefix}fraction-part`,
);

expect(fraction?.nativeElement.textContent).toEqual(`,00`);
expect(fraction?.nativeElement.textContent).toBe(`,00`);
});

it(`if Never is set, non zero decimals are not shown`, () => {
Expand All @@ -188,7 +188,7 @@ describe(`Money`, () => {
`${testContext.prefix}fraction-part`,
);

expect(fraction?.nativeElement.textContent).toEqual(``);
expect(fraction?.nativeElement.textContent).toBe(``);
});

it(`if precision = 4, shows 4 digits of decimal part`, () => {
Expand All @@ -200,15 +200,15 @@ describe(`Money`, () => {
`${testContext.prefix}fraction-part`,
);

expect(fraction?.nativeElement.textContent).toEqual(`,1230`);
expect(fraction?.nativeElement.textContent).toBe(`,1230`);
});
});

describe(`sign:`, () => {
it(`by default plus is not shown`, () => {
const sign = pageObject.getByAutomationId(`${testContext.prefix}sign`);

expect(sign?.nativeElement.textContent).toEqual(``);
expect(sign?.nativeElement.textContent).toBe(``);
});

it(`by default minus is not shown`, () => {
Expand All @@ -226,7 +226,7 @@ describe(`Money`, () => {

const sign = pageObject.getByAutomationId(`${testContext.prefix}sign`);

expect(sign?.nativeElement.textContent).toEqual(`+`);
expect(sign?.nativeElement.textContent).toBe(`+`);
});

it(`if set to ALWAYS, minus is shown`, () => {
Expand All @@ -245,7 +245,7 @@ describe(`Money`, () => {

const sign = pageObject.getByAutomationId(`${testContext.prefix}sign`);

expect(sign?.nativeElement.textContent).toEqual(``);
expect(sign?.nativeElement.textContent).toBe(``);
});

it(`if set to Never, minus is not shown`, () => {
Expand All @@ -255,7 +255,7 @@ describe(`Money`, () => {

const sign = pageObject.getByAutomationId(`${testContext.prefix}sign`);

expect(sign?.nativeElement.textContent).toEqual(``);
expect(sign?.nativeElement.textContent).toBe(``);
});

it(`if set to FORCE_NEGATIVE, minus is shown for positive numbers`, () => {
Expand Down Expand Up @@ -283,7 +283,7 @@ describe(`Money`, () => {

const sign = pageObject.getByAutomationId(`${testContext.prefix}sign`);

expect(sign?.nativeElement.textContent).toEqual(`+`);
expect(sign?.nativeElement.textContent).toBe(`+`);
});

it(`if set to FORCE_POSITIVE, plus is shown for negative numbers`, () => {
Expand All @@ -293,7 +293,7 @@ describe(`Money`, () => {

const sign = pageObject.getByAutomationId(`${testContext.prefix}sign`);

expect(sign?.nativeElement.textContent).toEqual(`+`);
expect(sign?.nativeElement.textContent).toBe(`+`);
});
});

Expand Down Expand Up @@ -369,6 +369,6 @@ describe(`Money`, () => {

const textContent = fixture.debugElement.nativeElement.textContent;

expect(textContent).toEqual(`237`);
expect(textContent).toBe(`237`);
});
});
Loading

0 comments on commit 1c09206

Please sign in to comment.