9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
39 lines
1.8 KiB
JavaScript
39 lines
1.8 KiB
JavaScript
import { describe, expect, it } from 'vitest';
|
|
import { getRegistry } from '@jackwener/opencli/registry';
|
|
import './publish.js';
|
|
describe('douyin publish registration', () => {
|
|
it('registers the publish command', () => {
|
|
const registry = getRegistry();
|
|
const cmds = [...registry.values()];
|
|
const cmd = cmds.find((c) => c.site === 'douyin' && c.name === 'publish');
|
|
expect(cmd).toBeDefined();
|
|
expect(cmd?.args.some((a) => a.name === 'video')).toBe(true);
|
|
expect(cmd?.args.some((a) => a.name === 'title')).toBe(true);
|
|
expect(cmd?.args.some((a) => a.name === 'schedule')).toBe(true);
|
|
});
|
|
it('has all expected args', () => {
|
|
const registry = getRegistry();
|
|
const cmd = [...registry.values()].find((c) => c.site === 'douyin' && c.name === 'publish');
|
|
const argNames = cmd?.args.map((a) => a.name) ?? [];
|
|
expect(argNames).toContain('video');
|
|
expect(argNames).toContain('title');
|
|
expect(argNames).toContain('schedule');
|
|
expect(argNames).toContain('caption');
|
|
expect(argNames).toContain('cover');
|
|
expect(argNames).toContain('visibility');
|
|
expect(argNames).toContain('allow_download');
|
|
expect(argNames).toContain('collection');
|
|
expect(argNames).toContain('activity');
|
|
expect(argNames).toContain('poi_id');
|
|
expect(argNames).toContain('poi_name');
|
|
expect(argNames).toContain('hotspot');
|
|
expect(argNames).toContain('no_safety_check');
|
|
expect(argNames).toContain('sync_toutiao');
|
|
});
|
|
it('uses COOKIE strategy', () => {
|
|
const registry = getRegistry();
|
|
const cmd = [...registry.values()].find((c) => c.site === 'douyin' && c.name === 'publish');
|
|
expect(cmd?.strategy).toBe('cookie');
|
|
});
|
|
});
|