-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* add share a note test * add the test for the shared note * minor fix * refactor the tests * change the cookie setting
- Loading branch information
1 parent
6d56d25
commit a3f0306
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {waitForModel, homepageSetup, setCookieAndVisitHome} from '../../support/utils' | ||
|
||
|
||
describe('share-a-note', () => { | ||
context('Open the model and access the list of notes', () => { | ||
beforeEach(() => { | ||
homepageSetup() | ||
}) | ||
|
||
it('check that clipboard is activated when a note is shared', () => { | ||
setCookieAndVisitHome() | ||
waitForModel() | ||
|
||
cy.get('[data-testid="Notes"]').click() | ||
cy.get('[data-testid="panelTitle"]').contains('NOTES') | ||
cy.get(':nth-child(1) > .MuiPaper-root > [data-testid="card-body"] > .MuiCardContent-root').contains('Test Issue body').click() | ||
cy.get('.MuiCardHeader-title').contains('Local issue 2') | ||
|
||
cy.window().then((win) => { | ||
cy.spy(win.navigator.clipboard, 'writeText').as('clipboardSpy') | ||
}) | ||
|
||
cy.get('.MuiCardActions-root > [data-testid="Share"] > .icon-share').click() | ||
|
||
// Now, verify that the clipboardSpy was called | ||
cy.get('@clipboardSpy').should('have.been.calledOnce') | ||
|
||
cy.get('.MuiSnackbarContent-message > .css-1xhj18k').contains('The url path is copied to the clipboard') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters