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
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Dataset API (E2E) > Dataset Paths 1`] = `
[
{
"layerName": "segmentation",
"magLinkInfos": [
{
"linkedMags": [],
"mag": {
"dataLayerName": "segmentation",
"dataSourceId": {
"name": "test-dataset",
"team": "Organization_X",
},
"hasLocalData": true,
"mag": [
1,
1,
1,
],
"path": "Organization_X/test-dataset/segmentation/1/",
"realPath": "Organization_X/test-dataset/segmentation/1/",
},
},
],
},
]
`;

exports[`Dataset API (E2E) > Zarr 3 streaming 1`] = `"{"zarr_format":3,"node_type":"group","attributes":{"ome":{"version":"0.5","multiscales":[{"name":"segmentation","axes":[{"name":"c","type":"channel"},{"name":"x","type":"space","unit":"nanometer"},{"name":"y","type":"space","unit":"nanometer"},{"name":"z","type":"space","unit":"nanometer"}],"datasets":[{"path":"1","coordinateTransformations":[{"type":"scale","scale":[1,11.24,11.24,28]}]}]}]}}}"`;

exports[`Dataset API (E2E) > Zarr 3 streaming 2`] = `"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAA="`;
Expand Down
31 changes: 31 additions & 0 deletions frontend/javascripts/test/backend-snapshot-tests/datasets.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,37 @@ describe("Dataset API (E2E)", () => {
expect(base64).toMatchSnapshot();
});

it("Dataset Paths", async () => {
const paths = await fetch(
"/api/datastores/localhost/datasources/Organization_X/test-dataset/paths?key=something-secure",
);
const pathsJson = await paths.json();

// Dataset paths are absolute, we will relativize them here to make the snapshot stable
const makeRelative = (path: string) =>
path.split("Organization_X")[1] ? "Organization_X" + path.split("Organization_X")[1] : path;

interface MagLink {
mag: {
path: string;
realPath: string;
};
}

interface PathInfo {
magLinkInfos: MagLink[];
}

pathsJson.forEach((pathInfo: PathInfo) =>
pathInfo.magLinkInfos.forEach((magLink: MagLink) => {
magLink.mag.path = makeRelative(magLink.mag.path);
magLink.mag.realPath = makeRelative(magLink.mag.realPath);
}),
);

expect(pathsJson).toMatchSnapshot();
});

/**
* WARNING: This test creates a side effect by uploading and saving a dataset in your binaryData folder.
* There is no clean up after the test, and the dataset will remain after each test run.
Expand Down