070959e133
landing-page-staging / Deploy landing page to staging (push) Has been skipped
landing-page-ci / Validate landing page (push) Failing after 4s
visual-baseline / Capture visual baselines (push) Has been cancelled
bake-plugin-previews / Bake plugin previews (push) Has been cancelled
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import {
|
|
DESIGN_SYSTEMS_USAGE,
|
|
isDesignSystemsHelpArg,
|
|
} from '../src/cli-help/index.js';
|
|
|
|
describe('od design-systems help surface', () => {
|
|
it('routes help, --help, and -h to the usage text', () => {
|
|
expect(isDesignSystemsHelpArg('help')).toBe(true);
|
|
expect(isDesignSystemsHelpArg('--help')).toBe(true);
|
|
expect(isDesignSystemsHelpArg('-h')).toBe(true);
|
|
});
|
|
|
|
it('does not treat subcommands or a missing arg as a help request', () => {
|
|
expect(isDesignSystemsHelpArg('list')).toBe(false);
|
|
expect(isDesignSystemsHelpArg('show')).toBe(false);
|
|
expect(isDesignSystemsHelpArg('rename')).toBe(false);
|
|
expect(isDesignSystemsHelpArg(undefined)).toBe(false);
|
|
});
|
|
|
|
it('advertises rename and import commands alongside list and show so the surface cannot drift', () => {
|
|
expect(DESIGN_SYSTEMS_USAGE).toContain('list');
|
|
expect(DESIGN_SYSTEMS_USAGE).toContain('show');
|
|
expect(DESIGN_SYSTEMS_USAGE).toContain('rename');
|
|
expect(DESIGN_SYSTEMS_USAGE).toContain('download');
|
|
expect(DESIGN_SYSTEMS_USAGE).toContain('import-local');
|
|
expect(DESIGN_SYSTEMS_USAGE).toContain('import-github');
|
|
expect(DESIGN_SYSTEMS_USAGE).toContain('import-shadcn');
|
|
expect(DESIGN_SYSTEMS_USAGE).toContain('rebuild-token-contract');
|
|
});
|
|
});
|