In app/index.spec.js, there are tests that still needs to be implemented:
it.todo('moves focus to the sidebarRef');
it.todo('moves focus back to the lastClickedInstructionRef');
Tried so far:
Using jest.spyOn.mockReturnValue to replace the ref returned from useRef() with something like { current: focus: jest.fn() }. This worked for overwriting the initial value of sidebarRef, but once that ref gets set to the h3 element inside of DetailsSidebar, current gets overwritten again with the actual element.
In
app/index.spec.js
, there are tests that still needs to be implemented:it.todo('moves focus to the sidebarRef');
it.todo('moves focus back to the lastClickedInstructionRef');
Tried so far:
useRef()
with something like{ current: focus: jest.fn() }
. This worked for overwriting the initial value of sidebarRef, but once that ref gets set to the h3 element inside of DetailsSidebar,current
gets overwritten again with the actual element.