Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/omezarr/src/zarr/types.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { describe, it, expect } from 'vitest';
import { CartesianPlane } from '@alleninstitute/vis-geometry';
import { OmeZarrAxisSchema } from './types';

describe('OmeZarrAxisSchema', () => {
it('should convert the axis name to lowercase when parsed to match our Cartesian Plane', () => {
const result = OmeZarrAxisSchema.parse({
name: 'X',
type: 'space',
});

// Create a concrete CartesianPlane to compare with so we know the parsed data will interop correctly
const plane = new CartesianPlane('xy');
expect(result.name).toBe(plane.u);
});
});
2 changes: 1 addition & 1 deletion packages/omezarr/src/zarr/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type OmeZarrAxis = {
};

export const OmeZarrAxisSchema: z.ZodType<OmeZarrAxis> = z.object({
name: z.string(),
name: z.string().toLowerCase(),
type: z.string(),
scale: z.number().optional(),
unit: z.string().optional(),
Expand Down