mirror of
https://github.com/immich-app/immich.git
synced 2026-02-14 12:58:17 +03:00
32 lines
823 B
TypeScript
32 lines
823 B
TypeScript
import { transformExtensions } from 'src/sql-tools/to-sql/transformers/extension.transformer';
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
describe(transformExtensions.name, () => {
|
|
describe('extension.drop', () => {
|
|
it('should work', () => {
|
|
expect(
|
|
transformExtensions({
|
|
type: 'extension.drop',
|
|
extensionName: 'cube',
|
|
reason: 'unknown',
|
|
}),
|
|
).toEqual(`DROP EXTENSION "cube";`);
|
|
});
|
|
});
|
|
|
|
describe('extension.create', () => {
|
|
it('should work', () => {
|
|
expect(
|
|
transformExtensions({
|
|
type: 'extension.create',
|
|
extension: {
|
|
name: 'cube',
|
|
synchronize: true,
|
|
},
|
|
reason: 'unknown',
|
|
}),
|
|
).toEqual(`CREATE EXTENSION IF NOT EXISTS "cube";`);
|
|
});
|
|
});
|
|
});
|