My team runs a website created with React. For various reasons, I need to use the deprecated document.execCommand('copy') method of copying to the clipboard. When writing jest unit tests, I am mocking execCommand and making sure it was called with expect(document.execCommand).toHaveBeenCalledWith('copy');
I want to test the actual contents of the clipboard after copying. Is there a way to test for this using jest?