wip
This commit is contained in:
30
tests/unit/website/structure/AlphaComponents.test.ts
Normal file
30
tests/unit/website/structure/AlphaComponents.test.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const alphaDir = path.resolve(__dirname, '../../../../apps/website/components/alpha');
|
||||
|
||||
const metaAllowlist = new Set([
|
||||
'FeatureLimitationTooltip.tsx',
|
||||
'CompanionInstructions.tsx',
|
||||
'CompanionStatus.tsx',
|
||||
'AlphaBanner.tsx',
|
||||
'AlphaFooter.tsx',
|
||||
'AlphaNav.tsx',
|
||||
]);
|
||||
|
||||
describe('Alpha components structure', () => {
|
||||
it('contains only alpha chrome and meta components', () => {
|
||||
const entries = fs.readdirSync(alphaDir);
|
||||
const tsxFiles = entries.filter((file) => file.endsWith('.tsx'));
|
||||
|
||||
const violations = tsxFiles.filter((file) => {
|
||||
if (metaAllowlist.has(file)) {
|
||||
return false;
|
||||
}
|
||||
return !file.startsWith('Alpha');
|
||||
});
|
||||
|
||||
expect(violations).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user