Fix test?

This commit is contained in:
Stefan Ålund
2020-10-18 07:53:22 +02:00
parent 7a2f8b04cd
commit d90a8109c2
2 changed files with 2 additions and 2 deletions
@@ -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>