I have a button that copies the token from localStorage to the clipboard and I want to compare the token from localStorage to the token in clipboard to check if the token was copied correctly.
My code:
cy.get('.copy-to-clipboard').click();
cy.window().its('navigator.clipboard').invoke('readText')
.should('equal', localStorage.getItem(accessTokenKey));
It's my only idea and it's bugging and not comparing correct values.