-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from Paymium/formIncrease
Form increase
- Loading branch information
Showing
18 changed files
with
499 additions
and
170 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'crossed-doc': minor | ||
--- | ||
|
||
add doc checkbox and radio |
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,5 @@ | ||
--- | ||
'@crossed/ui': minor | ||
--- | ||
|
||
Increase checkbox |
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,5 @@ | ||
--- | ||
'@crossed/ui': minor | ||
--- | ||
|
||
Increase Radio |
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,10 @@ | ||
--- | ||
'@crossed/next-adapter': patch | ||
'@crossed/primitive': patch | ||
'@crossed/loader': patch | ||
'@crossed/styled': patch | ||
'@crossed/core': patch | ||
'@crossed/ui': patch | ||
--- | ||
|
||
clean peerdependencies |
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
35 changes: 35 additions & 0 deletions
35
packages/ui/src/forms/Checkbox/__tests__/Checkbox.spec.tsx
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,35 @@ | ||
/** | ||
* Copyright (c) Paymium. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root of this projects source tree. | ||
*/ | ||
|
||
import { Checkbox } from '../index'; | ||
import { screen, render, fireEvent } from '@crossed/test'; | ||
|
||
describe('Checkbox', () => { | ||
test('Simple render', () => { | ||
const onPress = jest.fn(); | ||
render(<Checkbox onPress={onPress}>Simple</Checkbox>); | ||
const checkbox = screen.getByRole('checkbox'); | ||
expect(checkbox).toHaveAttribute('aria-checked', 'false'); | ||
fireEvent.click(checkbox); | ||
expect(checkbox).toHaveAttribute('aria-checked', 'true'); | ||
expect(onPress).toHaveBeenCalled(); | ||
}); | ||
|
||
test('Disabled', () => { | ||
const onPress = jest.fn(); | ||
render( | ||
<Checkbox onPress={onPress} disabled> | ||
Simple | ||
</Checkbox> | ||
); | ||
const checkbox = screen.getByRole('checkbox'); | ||
expect(checkbox).toHaveAttribute('aria-checked', 'false'); | ||
fireEvent.click(checkbox); | ||
expect(checkbox).toHaveAttribute('aria-checked', 'false'); | ||
expect(onPress).not.toHaveBeenCalled(); | ||
}); | ||
}); |
Oops, something went wrong.