diff --git a/cypress/e2e/content/article-links.cy.js b/cypress/e2e/content/article-links.cy.js index 24f799b0d..3a24f75bf 100644 --- a/cypress/e2e/content/article-links.cy.js +++ b/cypress/e2e/content/article-links.cy.js @@ -1,8 +1,10 @@ /// describe('Article', () => { - let subjects = Cypress.env('test_subjects') - ? Cypress.env('test_subjects').split(',').filter(s => s.trim() !== '') + let subjects = Cypress.env('test_subjects') + ? Cypress.env('test_subjects') + .split(',') + .filter((s) => s.trim() !== '') : []; let validationStrategy = null; @@ -221,7 +223,9 @@ describe('Article', () => { // In fallback mode, if we have no subjects, that might be expected if (subjects.length === 0) { cy.log('ℹ️ No subjects to test in fallback mode'); - cy.log(' This indicates no test subjects were provided to the runner'); + cy.log( + ' This indicates no test subjects were provided to the runner' + ); } else { cy.log(`✅ Testing ${subjects.length} subjects in fallback mode`); } @@ -233,13 +237,19 @@ describe('Article', () => { // Don't fail if this is expected (cache hit scenario) const testSubjectsData = Cypress.env('test_subjects_data'); - if (testSubjectsData && testSubjectsData !== '[]' && testSubjectsData !== '') { + if ( + testSubjectsData && + testSubjectsData !== '[]' && + testSubjectsData !== '' + ) { cy.log('✅ Cache optimization active - this is expected'); cy.log('ℹ️ Test subjects data is available, all files cached'); } else { cy.log('⚠️ No test subjects data available'); cy.log(' This may indicate no files were provided to test'); - cy.log(' This is not necessarily an error - may be expected for some runs'); + cy.log( + ' This is not necessarily an error - may be expected for some runs' + ); } } else { cy.log(`✅ Ready to test ${subjects.length} pages`); @@ -252,18 +262,24 @@ describe('Article', () => { // Check for truly problematic scenarios if (!validationStrategy && subjects.length === 0) { const testSubjectsData = Cypress.env('test_subjects_data'); - if (!testSubjectsData || testSubjectsData === '' || testSubjectsData === '[]') { + if ( + !testSubjectsData || + testSubjectsData === '' || + testSubjectsData === '[]' + ) { cy.log('❌ Critical setup issue detected:'); cy.log(' • No validation strategy'); cy.log(' • No test subjects'); cy.log(' • No test subjects data'); cy.log(' This indicates a fundamental configuration problem'); - + // Only fail in this truly problematic case - throw new Error('Critical test setup failure: No strategy, subjects, or data available'); + throw new Error( + 'Critical test setup failure: No strategy, subjects, or data available' + ); } } - + // Always pass if we get to this point - the setup is valid cy.log('✅ Test setup validation completed successfully'); });