-
-
Notifications
You must be signed in to change notification settings - Fork 703
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
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
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,43 @@ | ||
context('Slots', () => { | ||
describe('Block Default View / Edit', () => { | ||
beforeEach(() => { | ||
cy.intercept('GET', `/**/*?expand*`).as('content'); | ||
cy.intercept('GET', '/**/Document').as('schema'); | ||
// given a logged in editor and a page in edit mode | ||
cy.autologin(); | ||
cy.createContent({ | ||
contentType: 'Document', | ||
contentId: 'document', | ||
contentTitle: 'Test document', | ||
}); | ||
cy.createContent({ | ||
contentType: 'Document', | ||
contentId: 'hello', | ||
contentTitle: 'Test document Hello', | ||
}); | ||
|
||
cy.visit('/'); | ||
cy.wait('@content'); | ||
}); | ||
|
||
it('[ContentTypeCondition(["Document"]), RouteCondition("/hello")] only renders when the predicates are true', function () { | ||
cy.get('body').should( | ||
'not.include.text', | ||
'This is a test slot component', | ||
); | ||
|
||
cy.navigate('/document'); | ||
cy.wait('@content'); | ||
|
||
cy.get('body').should( | ||
'not.include.text', | ||
'This is a test slot component', | ||
); | ||
|
||
cy.navigate('/hello'); | ||
cy.wait('@content'); | ||
|
||
cy.get('body').should('include.text', 'This is a test slot component'); | ||
}); | ||
}); | ||
}); |