Skip to content

Commit b40fd27

Browse files
committed
Update tests.
1 parent db6a241 commit b40fd27

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • assets/js/components/email-reporting/UserSettingsSelectionPanel

assets/js/components/email-reporting/UserSettingsSelectionPanel/index.test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,31 @@ describe( 'UserSettingsSelectionPanel', () => {
133133
expect( dialog ).toHaveAttribute( 'aria-hidden', 'false' );
134134
} );
135135

136+
it( 'hides admin screen tooltip when the panel opens', async () => {
137+
registry
138+
.dispatch( CORE_UI )
139+
.setValue( USER_SETTINGS_SELECTION_PANEL_OPENED_KEY, false );
140+
registry.dispatch( CORE_UI ).setValue( 'admin-screen-tooltip', {
141+
isTooltipVisible: true,
142+
} );
143+
144+
render( <UserSettingsSelectionPanel />, {
145+
registry,
146+
features,
147+
viewContext: VIEW_CONTEXT_MAIN_DASHBOARD,
148+
} );
149+
150+
registry
151+
.dispatch( CORE_UI )
152+
.setValue( USER_SETTINGS_SELECTION_PANEL_OPENED_KEY, true );
153+
154+
await waitFor( () =>
155+
expect(
156+
registry.select( CORE_UI ).getValue( 'admin-screen-tooltip' )
157+
).toMatchObject( { isTooltipVisible: false } )
158+
);
159+
} );
160+
136161
it( 'calls saveEmailReportingSettings with subscribed true when subscribing', async () => {
137162
const coreUserDispatch = registry.dispatch( CORE_USER );
138163
const saveSpy = jest

0 commit comments

Comments
 (0)