2021-10-05 15:52:03 -04:00
|
|
|
// / <reference types="Cypress" />
|
|
|
|
|
2022-04-07 13:14:54 -04:00
|
|
|
import {PAGES_ENDPOINTS} from '../LegacyTests/constants';
|
|
|
|
|
2021-10-05 15:52:03 -04:00
|
|
|
describe('Do all the English pages have all links with a defined href attribute?', () => {
|
2022-04-07 13:14:54 -04:00
|
|
|
const pages = Object.values(PAGES_ENDPOINTS);
|
2021-10-05 15:52:03 -04:00
|
|
|
|
|
|
|
pages.forEach((page) => {
|
|
|
|
it(`test all href attr on ${page} page`, () => {
|
|
|
|
cy.visit(page);
|
|
|
|
|
|
|
|
// Checks to make sure all a tags have an href:
|
|
|
|
cy.get('a').each(($a) => {
|
|
|
|
const message = $a.text();
|
|
|
|
expect($a, message).to.have.attr('href').not.contain('undefined');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|