Fix test?
This commit is contained in:
@@ -32,10 +32,9 @@ describe('<PinButton />', () => {
|
||||
</SidebarPinStateContext.Provider>,
|
||||
),
|
||||
);
|
||||
|
||||
expect(rendered.getByText('Pin Sidebar')).toBeInTheDocument();
|
||||
|
||||
const pinButton = rendered.getByTitle('Pin Sidebar');
|
||||
const pinButton = rendered.getByTestId('pin');
|
||||
fireEvent.click(pinButton);
|
||||
expect(mockToggleFn).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -46,6 +46,7 @@ export const PinButton = () => {
|
||||
checked={isPinned}
|
||||
onChange={() => toggleSidebarPinState()}
|
||||
name="pin"
|
||||
data-test-id="pin"
|
||||
/>
|
||||
</Tooltip>
|
||||
</ListItemSecondaryAction>
|
||||
|
||||
Reference in New Issue
Block a user