-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Add data attribute for post e2e * feat: Add basic post e2e * fix: Type Error * fix: Syntax error
- Loading branch information
1 parent
f6c6f86
commit d193bfb
Showing
4 changed files
with
26 additions
and
10 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 |
---|---|---|
@@ -1,16 +1,31 @@ | ||
describe('Post is effective', () => { | ||
it('Page is effective', () => { | ||
cy.visit('/post/demo-post', { failOnStatusCode: false }); | ||
beforeEach(() => { | ||
cy.visit('/post/demo-post'); | ||
}); | ||
|
||
// Post Header | ||
it('Header should visible and working', () => { | ||
cy.dataCy('post-icon-container').find('svg').should('exist'); | ||
cy.dataCy('post-title').should('have.prop', 'tagName', 'H1').should('not.be.empty'); | ||
cy.dataCy('post-subtitle').should('not.be.empty'); | ||
cy.dataCy('category').should('not.be.empty'); | ||
cy.dataCy('tags') | ||
.find('[data-cy=tag]') | ||
.each(($tag) => { | ||
cy.wrap($tag).should('not.be.empty'); | ||
cy.dataCy('tag-link').each(($link) => { | ||
cy.wrap($link).should('not.be.empty'); | ||
cy.request('GET', $link.attr('href')).its('status').should('eq', 200); | ||
}); | ||
}); | ||
|
||
it('Comment should load', () => { | ||
cy.dataCy('post-comment').scrollIntoView(); | ||
cy.dataCy('post-comment').should('not.be.empty'); | ||
}); | ||
|
||
it('Heading links should visible and working', () => { | ||
cy.dataCy('post-content') | ||
.find( | ||
'h2 .rehype-auto-link, h3 .rehype-auto-link, h4 .rehype-auto-link, h5 .rehype-auto-link, h6 .rehype-auto-link', | ||
) | ||
.each(($link) => { | ||
cy.request('GET', $link.attr('href')).its('status').should('eq', 200); | ||
}); | ||
}); | ||
}); |
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
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