File tree 2 files changed +10
-6
lines changed
packages/compass-components/src/components/workspace-tabs
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ describe('Tab', function () {
44
44
. visible ;
45
45
} ) ;
46
46
47
+ it ( 'should render the close tab button visible' , async function ( ) {
48
+ expect ( await screen . findByLabelText ( 'Close Tab' ) ) . to . be . visible ;
49
+ } ) ;
50
+
47
51
it ( 'should call "onClose" when the close button is clicked' , async function ( ) {
48
52
expect ( onCloseSpy . callCount ) . to . equal ( 0 ) ;
49
53
const closeTabButton = await screen . findByLabelText ( 'Close Tab' ) ;
@@ -74,6 +78,10 @@ describe('Tab', function () {
74
78
) ;
75
79
} ) ;
76
80
81
+ it ( 'should render the close tab button hidden' , async function ( ) {
82
+ expect ( await screen . findByLabelText ( 'Close Tab' ) ) . to . not . be . visible ;
83
+ } ) ;
84
+
77
85
// Focus visible is not working proper in jsdom environment
78
86
it . skip ( 'should render the close tab button visible when the tab is focused' , async function ( ) {
79
87
const tabToFocus = await screen . findByRole ( 'tab' ) ;
Original file line number Diff line number Diff line change @@ -170,15 +170,11 @@ const tabSubtitleStyles = css({
170
170
} ) ;
171
171
172
172
const closeButtonStyles = css ( {
173
- transition : tabTransition ,
174
- transitionProperty : 'opacity, transform' ,
175
- transform : 'translateY(44px)' ,
176
- opacity : 0 ,
173
+ visibility : 'hidden' ,
177
174
} ) ;
178
175
179
176
const selectedCloseButtonStyles = css ( {
180
- transform : 'translateY(0)' ,
181
- opacity : 1 ,
177
+ visibility : 'visible' ,
182
178
} ) ;
183
179
184
180
type IconGlyph = Extract < keyof typeof glyphs , string > ;
You can’t perform that action at this time.
0 commit comments