-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jmainguytalend
committed
Feb 16, 2024
1 parent
ca74483
commit 02c6eac
Showing
3 changed files
with
33 additions
and
1 deletion.
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 @@ | ||
--- | ||
'@talend/design-system': minor | ||
--- | ||
|
||
chore: add data-test attr on stacks |
25 changes: 25 additions & 0 deletions
25
packages/design-system/src/components/Stack/Primitive/StackPrimitive.test.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,25 @@ | ||
import { expect } from '@jest/globals'; | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
import StackPrimitive from './StackPrimitive'; | ||
|
||
describe('StackPrimitive', () => { | ||
it('Should render with data-test attributes', async () => { | ||
render( | ||
<StackPrimitive | ||
data-test="my-stack" | ||
data-testid="my-stack-testid" | ||
data-feature="my-stack-feature" | ||
gap={0} | ||
> | ||
text | ||
</StackPrimitive>, | ||
); | ||
|
||
const stack = screen.getByTestId('my-stack-testid'); | ||
expect(stack).toBeInTheDocument(); | ||
|
||
expect(stack).toHaveAttribute('data-test', 'my-stack'); | ||
expect(stack).toHaveAttribute('data-feature', 'my-stack-feature'); | ||
}); | ||
}); |
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