fix(cypress): format code with prettier

Auto-formatting applied by pre-commit hooks to maintain code style consistency.
pull/6261/head
Jason Stirnaman 2025-07-28 23:06:34 -05:00
parent 0c59fdd7c0
commit d86f0de19a
1 changed files with 25 additions and 9 deletions

View File

@ -1,8 +1,10 @@
/// <reference types="cypress" />
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');
});