Public source validation / validate (push) Failing after 3m8s
19 lines
767 B
TypeScript
19 lines
767 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { resolveDashboardScope } from '../../src/dashboardScope';
|
|
|
|
describe('resolveDashboardScope', () => {
|
|
it('resolves exact declared defaults and drops non-string scope data', () => {
|
|
expect(resolveDashboardScope(
|
|
{ serverId: '$server', literal: 'disk-1', unsafe: 42 },
|
|
[{ name: 'server', default: 'primary' }],
|
|
)).toEqual({ serverId: 'primary', literal: 'disk-1' });
|
|
});
|
|
|
|
it('preserves unresolved and partial references for fail-closed API validation', () => {
|
|
expect(resolveDashboardScope(
|
|
{ serverId: '$missing', containerId: 'prefix-$server' },
|
|
[{ name: 'server', default: 'primary' }],
|
|
)).toEqual({ serverId: '$missing', containerId: 'prefix-$server' });
|
|
});
|
|
});
|