diff --git a/scripts/verify-angular-support.mjs b/scripts/verify-angular-support.mjs index 2752a94d3..e45873f21 100644 --- a/scripts/verify-angular-support.mjs +++ b/scripts/verify-angular-support.mjs @@ -8,11 +8,7 @@ import { ANGULAR_PEER_RANGE, SUPPORTED_ANGULAR_MAJORS, } from '../examples/chat/smoke/angular-versions.mjs'; -import { - WEBSITE_ANGULAR_SUPPORT_ROWS, - WEBSITE_PRICING_SUPPORT_SUMMARY, - WEBSITE_SUPPORTED_ANGULAR_MAJORS, -} from '../apps/website/src/components/pricing/angular-support.mjs'; +import { WEBSITE_SUPPORTED_ANGULAR_MAJORS } from '../apps/website/src/components/pricing/angular-support.mjs'; export { ANGULAR_PEER_RANGE }; @@ -248,19 +244,20 @@ export async function verifyDocumentation({ root = process.cwd() } = {}) { } } +/** + * The pricing page's Angular compatibility matrix and support summary were + * removed in #908, taking WEBSITE_ANGULAR_SUPPORT_ROWS and + * WEBSITE_PRICING_SUPPORT_SUMMARY with them. The row/summary assertions that + * used to live here verified copy that no longer renders anywhere, so they are + * gone too. WEBSITE_SUPPORTED_ANGULAR_MAJORS still backs live page content and + * is still checked against the registry. + */ export async function verifyWebsiteMajors({ - websiteAngularSupportRows = WEBSITE_ANGULAR_SUPPORT_ROWS, - websitePricingSupportSummary = WEBSITE_PRICING_SUPPORT_SUMMARY, websiteSupportedAngularMajors = WEBSITE_SUPPORTED_ANGULAR_MAJORS, } = {}) { const errors = []; const expectedMajors = SUPPORTED_ANGULAR_MAJORS.join(', '); const actualMajors = websiteSupportedAngularMajors.join(', '); - const expectedSupportedVersions = `Angular ${expectedMajors}`; - const expectedPricingSupportSummary = `Angular ${SUPPORTED_ANGULAR_MAJORS.slice( - 0, - -1 - ).join(', ')}, and ${SUPPORTED_ANGULAR_MAJORS.at(-1)} support`; if ( websiteSupportedAngularMajors.length !== SUPPORTED_ANGULAR_MAJORS.length || @@ -273,45 +270,6 @@ export async function verifyWebsiteMajors({ ); } - const supportedRows = websiteAngularSupportRows.filter( - (row) => row.label === 'Supported' - ); - const plannedRows = websiteAngularSupportRows.filter( - (row) => row.label === 'Planned' - ); - - if (supportedRows.length !== 1) { - errors.push( - `website must contain exactly one Supported row but found ${supportedRows.length}.` - ); - } else if (supportedRows[0].versions !== expectedSupportedVersions) { - errors.push( - `website Supported row versions expected "${expectedSupportedVersions}" but found "${supportedRows[0].versions}".` - ); - } - - if (plannedRows.length !== 1) { - errors.push( - `website must contain exactly one Planned row but found ${plannedRows.length}.` - ); - } - - if (websitePricingSupportSummary !== expectedPricingSupportSummary) { - errors.push( - `website pricing support summary expected "${expectedPricingSupportSummary}" but found "${websitePricingSupportSummary}".` - ); - } - - for (const plannedRow of plannedRows) { - for (const major of SUPPORTED_ANGULAR_MAJORS) { - if (new RegExp(`\\b${major}\\b`).test(plannedRow.versions)) { - errors.push( - `website Planned row must not contain supported Angular major ${major}.` - ); - } - } - } - if (errors.length > 0) { throw new Error(errors.join('\n')); } diff --git a/scripts/verify-angular-support.spec.mjs b/scripts/verify-angular-support.spec.mjs index 6c3a1f822..ab02dd6a9 100644 --- a/scripts/verify-angular-support.spec.mjs +++ b/scripts/verify-angular-support.spec.mjs @@ -59,26 +59,8 @@ function runNode(args) { }); } -function createWebsiteFixture({ - supportedMajors = [20, 21, 22], - supportedVersions = 'Angular 20, 21, 22', - plannedVersions = '—', - pricingSupportSummary = 'Angular 20, 21, and 22 support', -} = {}) { - return { - websiteAngularSupportRows: [ - { - label: 'Supported', - versions: supportedVersions, - tone: 'success', - }, - { label: 'Experimental', versions: '—', tone: 'warn' }, - { label: 'Planned', versions: plannedVersions, tone: 'info' }, - { label: 'Unsupported', versions: 'Angular ≤19', tone: 'muted' }, - ], - websiteSupportedAngularMajors: supportedMajors, - websitePricingSupportSummary: pricingSupportSummary, - }; +function createWebsiteFixture({ supportedMajors = [20, 21, 22] } = {}) { + return { websiteSupportedAngularMajors: supportedMajors }; } async function createDocumentationFixture(t, updateDocumentation) { @@ -248,94 +230,6 @@ test('reports website support data that advertises Angular 23', async () => { ); }); -test('reports a supported Angular major under the website Planned row', async () => { - await assert.rejects( - verifyWebsiteMajors( - createWebsiteFixture({ plannedVersions: 'Angular 22' }) - ), - /website Planned row must not contain supported Angular major 22/ - ); -}); - -test('reports Supported row text that omits Angular 22', async () => { - await assert.rejects( - verifyWebsiteMajors( - createWebsiteFixture({ supportedVersions: 'Angular 20, 21' }) - ), - /website Supported row versions expected "Angular 20, 21, 22" but found "Angular 20, 21"/ - ); -}); - -test('reports Supported row text that advertises Angular 23', async () => { - await assert.rejects( - verifyWebsiteMajors( - createWebsiteFixture({ supportedVersions: 'Angular 20, 21, 22, 23' }) - ), - /website Supported row versions expected "Angular 20, 21, 22" but found "Angular 20, 21, 22, 23"/ - ); -}); - -test('reports a missing website Supported row', async () => { - const fixture = createWebsiteFixture(); - fixture.websiteAngularSupportRows = fixture.websiteAngularSupportRows.filter( - (row) => row.label !== 'Supported' - ); - - await assert.rejects( - verifyWebsiteMajors(fixture), - /website must contain exactly one Supported row but found 0/ - ); -}); - -test('reports duplicate website Supported rows', async () => { - const fixture = createWebsiteFixture(); - fixture.websiteAngularSupportRows = [ - ...fixture.websiteAngularSupportRows, - { label: 'Supported', versions: 'Angular 20, 21, 22', tone: 'success' }, - ]; - - await assert.rejects( - verifyWebsiteMajors(fixture), - /website must contain exactly one Supported row but found 2/ - ); -}); - -test('reports a missing website Planned row', async () => { - const fixture = createWebsiteFixture(); - fixture.websiteAngularSupportRows = fixture.websiteAngularSupportRows.filter( - (row) => row.label !== 'Planned' - ); - - await assert.rejects( - verifyWebsiteMajors(fixture), - /website must contain exactly one Planned row but found 0/ - ); -}); - -test('reports duplicate website Planned rows', async () => { - const fixture = createWebsiteFixture(); - fixture.websiteAngularSupportRows = [ - ...fixture.websiteAngularSupportRows, - { label: 'Planned', versions: '—', tone: 'info' }, - ]; - - await assert.rejects( - verifyWebsiteMajors(fixture), - /website must contain exactly one Planned row but found 2/ - ); -}); - -test('reports a pricing support summary that drifts from website majors', async () => { - await assert.rejects( - verifyWebsiteMajors( - createWebsiteFixture({ - pricingSupportSummary: 'Angular 20 and 21 support', - }) - ), - /website pricing support summary expected "Angular 20, 21, and 22 support" but found "Angular 20 and 21 support"/ - ); -}); - test('reports a peer range that omits Angular 22', async (t) => { const root = await createFixture(t, async (fixtureRoot) => { await writeJson(join(fixtureRoot, 'libs/chat/package.json'), {