-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kit)!:
Slider
| InputSlider
| Range
| InputRange
use str…
…ict version of `TuiKeySteps` (#2220) * feat(kit)!: `Slider` | `InputSlider` | `Range` | `InputRange` use strict version of `TuiKeySteps` * chore: apply changes after linting [tinkoff-bot] Co-authored-by: tinkoff-bot <[email protected]>
- Loading branch information
Showing
11 changed files
with
113 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import {TuiKeySteps} from '@taiga-ui/kit'; | ||
|
||
describe(`TuiKeySteps type`, () => { | ||
/** | ||
* Let's check that type {@link TuiKeySteps} works as expected using @ts-expect-error | ||
* @link https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#-ts-expect-error-comments | ||
*/ | ||
|
||
describe(`Valid cases`, () => { | ||
it(`Min + Max + values between`, () => { | ||
const keySteps: TuiKeySteps = [ | ||
[0, 10], | ||
[25, 10_000], | ||
[50, 100_000], | ||
[75, 500_000], | ||
[100, 1_000_000], | ||
]; | ||
|
||
expect(keySteps).toBeDefined(); | ||
}); | ||
|
||
it(`Min + Max (NO values between)`, () => { | ||
const keySteps: TuiKeySteps = [ | ||
[0, 10], | ||
[100, 1_000_000], | ||
]; | ||
|
||
expect(keySteps).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe(`Invalid cases`, () => { | ||
it(`no minimum`, () => { | ||
const keySteps: TuiKeySteps = [ | ||
// @ts-expect-error | ||
[25, 10_000], | ||
[50, 100_000], | ||
[75, 500_000], | ||
[100, 1_000_000], | ||
]; | ||
|
||
expect(keySteps).toBeDefined(); | ||
}); | ||
|
||
it(`no maximum`, () => { | ||
// @ts-expect-error | ||
const keySteps: TuiKeySteps = [ | ||
[0, 0], | ||
[25, 10_000], | ||
[50, 100_000], | ||
[75, 500_000], | ||
]; | ||
|
||
expect(keySteps).toBeDefined(); | ||
}); | ||
|
||
it(`no max and no min`, () => { | ||
const keySteps: TuiKeySteps = [ | ||
// @ts-expect-error | ||
[25, 10_000], | ||
[50, 100_000], | ||
[75, 500_000], | ||
]; | ||
|
||
expect(keySteps).toBeDefined(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters