-
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.
- Loading branch information
1 parent
636a19e
commit bc55c0f
Showing
3 changed files
with
61 additions
and
61 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,51 @@ | ||
describe('Post is effective', () => { | ||
beforeEach(() => { | ||
cy.visit('/post/demo-post'); | ||
}); | ||
|
||
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('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); | ||
}); | ||
}); | ||
|
||
it('Series recommendation should visible and working', () => { | ||
cy.dataCy('series-summary').should('not.be.empty'); | ||
cy.dataCy('post-title') | ||
.invoke('text') | ||
.then((postTitle) => { | ||
cy.wrap(postTitle).as('postTitle'); | ||
}); | ||
|
||
cy.dataCy('series-active') | ||
.should('have.length', 1) | ||
.invoke('text') | ||
.then((activeSeriesTitle) => { | ||
cy.wrap(activeSeriesTitle).as('activeSeriesTitle'); | ||
}); | ||
|
||
Promise.all([cy.get('@postTitle'), cy.get('@activeSeriesTitle')]).then(([postTitle, activeSeriesTitle]) => { | ||
expect(postTitle).to.equal(activeSeriesTitle); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
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,51 +1,19 @@ | ||
describe('Post is effective', () => { | ||
describe('All post page is effective', () => { | ||
beforeEach(() => { | ||
cy.visit('/post/demo-post'); | ||
cy.visit('/post/'); | ||
}); | ||
|
||
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('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) => { | ||
it('Post taxonomy links should work', () => { | ||
cy.dataCy('categories-link') | ||
.should('be.visible') | ||
.then(($link) => { | ||
cy.request('GET', $link.attr('href')).its('status').should('eq', 200); | ||
}); | ||
}); | ||
|
||
it('Series recommendation should visible and working', () => { | ||
cy.dataCy('series-summary').should('not.be.empty'); | ||
cy.dataCy('post-title') | ||
.invoke('text') | ||
.then((postTitle) => { | ||
cy.wrap(postTitle).as('postTitle'); | ||
}); | ||
|
||
cy.dataCy('series-active') | ||
.should('have.length', 1) | ||
.invoke('text') | ||
.then((activeSeriesTitle) => { | ||
cy.wrap(activeSeriesTitle).as('activeSeriesTitle'); | ||
cy.dataCy('tags-link') | ||
.should('be.visible') | ||
.then(($link) => { | ||
cy.request('GET', $link.attr('href')).its('status').should('eq', 200); | ||
}); | ||
|
||
Promise.all([cy.get('@postTitle'), cy.get('@activeSeriesTitle')]).then(([postTitle, activeSeriesTitle]) => { | ||
expect(postTitle).to.equal(activeSeriesTitle); | ||
}); | ||
}); | ||
}); |