Skip to content

Commit c1c718e

Browse files
authored
Merge pull request #215 from archivesspace/minor-test-updates
Tweak content pages and sitemap tests
2 parents ee4dcc1 + 7e7aa92 commit c1c718e

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

cypress/e2e/content-pages.cy.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
describe('Content pages', () => {
2-
it('show the sidebar, table of contents, and footer meta and pagination sections', () => {
2+
it('show the sidebar, table of contents, and appropriate footer sections', () => {
33
cy.visit('/architecture/jsonmodel')
44
const firstPage = cy.url()
55
cy.get('#starlight__sidebar')
@@ -9,6 +9,7 @@ describe('Content pages', () => {
99
cy.get('footer p').contains('Last updated: ')
1010
cy.get('footer a').contains('Previous')
1111
cy.get('footer a').contains('Next').click()
12+
cy.get('footer').contains('Built with Starlight').should('not.exist')
1213

1314
cy.url() !== firstPage
1415
cy.get('#starlight__sidebar')
@@ -18,5 +19,6 @@ describe('Content pages', () => {
1819
cy.get('footer p').contains('Last updated: ')
1920
cy.get('footer a').contains('Previous')
2021
cy.get('footer a').contains('Next')
22+
cy.get('footer').contains('Built with Starlight').should('not.exist')
2123
})
2224
})

cypress/e2e/sitemap.cy.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
1+
const indexPath = '/sitemap-index.xml'
2+
13
describe('Sitemap', () => {
24
if (Cypress.env('MODE') === 'production') {
35
it('assets are present', () => {
4-
cy.request('/sitemap-index.xml')
6+
cy.request(indexPath)
57
cy.request('/sitemap-0.xml')
68
})
79
}
810

911
it('is linked from each page', () => {
1012
cy.visit('/')
11-
cy.get("link[rel='sitemap']").should(
12-
'have.attr',
13-
'href',
14-
'/sitemap-index.xml'
15-
)
13+
cy.get("link[rel='sitemap']").should('have.attr', 'href', indexPath)
1614

1715
cy.visit('/architecture/jsonmodel')
18-
cy.get("link[rel='sitemap']").should(
19-
'have.attr',
20-
'href',
21-
'/sitemap-index.xml'
22-
)
16+
cy.get("link[rel='sitemap']").should('have.attr', 'href', indexPath)
2317
})
2418
})

0 commit comments

Comments
 (0)