mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-21 13:47:39 +02:00
Upgrades biome to 1.6.1, and updates husky pre-commit hook. Most changes here are making type imports explicit.
38 lines
959 B
TypeScript
38 lines
959 B
TypeScript
import { validateSchema } from '../validate';
|
|
import type { MeSchema } from './me-schema';
|
|
|
|
test('meSchema', () => {
|
|
const data: MeSchema = {
|
|
user: { id: 1 },
|
|
permissions: [{ permission: 'a' }],
|
|
feedback: [{ userId: 1, feedbackId: 'a', neverShow: false }],
|
|
splash: { a: true },
|
|
};
|
|
|
|
expect(
|
|
validateSchema('#/components/schemas/meSchema', data),
|
|
).toBeUndefined();
|
|
});
|
|
|
|
test('meSchema empty', () => {
|
|
expect(
|
|
validateSchema('#/components/schemas/meSchema', {}),
|
|
).toMatchSnapshot();
|
|
});
|
|
|
|
test('meSchema missing permissions', () => {
|
|
expect(
|
|
validateSchema('#/components/schemas/meSchema', { user: { id: 1 } }),
|
|
).toMatchSnapshot();
|
|
});
|
|
|
|
test('meSchema missing splash', () => {
|
|
expect(
|
|
validateSchema('#/components/schemas/meSchema', {
|
|
user: { id: 1 },
|
|
permissions: [],
|
|
feedback: [],
|
|
}),
|
|
).toMatchSnapshot();
|
|
});
|