-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into jzempel/element-types
- Loading branch information
Showing
11 changed files
with
145 additions
and
19 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
41 changes: 41 additions & 0 deletions
41
packages/chrome/src/styled/sheet/StyledSheetHeader.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,41 @@ | ||
/** | ||
* Copyright Zendesk, Inc. | ||
* | ||
* Use of this source code is governed under the Apache License, Version 2.0 | ||
* found at http://www.apache.org/licenses/LICENSE-2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { renderRtl, render, screen } from 'garden-test-utils'; | ||
import { DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming'; | ||
|
||
import { StyledSheetHeader } from './StyledSheetHeader'; | ||
|
||
describe('StyledSheetHeader', () => { | ||
it('renders default styling', () => { | ||
render(<StyledSheetHeader>Header</StyledSheetHeader>); | ||
|
||
expect(screen.getByText('Header')).toHaveStyleRule( | ||
'border-bottom', | ||
`${DEFAULT_THEME.borders.sm} ${getColor('neutralHue', 300, DEFAULT_THEME)}` | ||
); | ||
}); | ||
|
||
it('renders correctly when button is present', () => { | ||
render(<StyledSheetHeader isCloseButtonPresent>Header</StyledSheetHeader>); | ||
|
||
expect(screen.getByText('Header')).toHaveStyleRule( | ||
'padding-right', | ||
`${DEFAULT_THEME.space.base * 14}px` | ||
); | ||
}); | ||
|
||
it('renders correctly in rtl mode when button is present', () => { | ||
renderRtl(<StyledSheetHeader isCloseButtonPresent>Header</StyledSheetHeader>); | ||
|
||
expect(screen.getByText('Header')).toHaveStyleRule( | ||
'padding-left', | ||
`${DEFAULT_THEME.space.base * 14}px` | ||
); | ||
}); | ||
}); |
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