Skip to content

Commit f4f26f9

Browse files
committed
Minor fixes
1 parent 16624e0 commit f4f26f9

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/routes/v2/projects/[projectId]/datasets/[datasetId]/+page.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
/** @type {CreateUpdateImageModal|undefined} */
4949
let imageModal = undefined;
5050
51-
$: plates = imagePage.attributes['plate'] || [];
51+
$: plates = Array.isArray(imagePage.attributes['plate'])
52+
? imagePage.attributes['plate'].sort()
53+
: [];
5254
let selectedPlate = '';
5355
let platePath = '';
5456
let platePathLoading = false;

tests/v2/images.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test('Dataset images [v2]', async ({ page, project }) => {
2424
await test.step('Open test dataset', async () => {
2525
await page.getByRole('link', { name: 'test-dataset' }).click();
2626
await page.waitForURL(/\/v2\/projects\/\d+\/datasets\/\d+/);
27-
expect(await page.getByText('No entries in the image list yet').isVisible()).toEqual(true);
27+
await expect(page.getByText('No entries in the image list yet')).toBeVisible();
2828
});
2929

3030
await test.step('Create an image without filters', async () => {

tests/v2/view_plate.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test('View plate', async ({ page, project }) => {
2121
await test.step('Open test dataset', async () => {
2222
await page.getByRole('link', { name: 'test-dataset' }).click();
2323
await page.waitForURL(/\/v2\/projects\/\d+\/datasets\/\d+/);
24-
expect(await page.getByText('No entries in the image list yet').isVisible()).toEqual(true);
24+
await expect(page.getByText('No entries in the image list yet')).toBeVisible();
2525
});
2626

2727
await test.step('Create test images', async () => {
@@ -83,7 +83,7 @@ test('View plate', async ({ page, project }) => {
8383
await test.step('Open test dataset 2 and create new image', async () => {
8484
await page.getByRole('link', { name: 'test-dataset-2' }).click();
8585
await page.waitForURL(/\/v2\/projects\/\d+\/datasets\/\d+/);
86-
expect(await page.getByText('No entries in the image list yet').isVisible()).toEqual(true);
86+
await expect(page.getByText('No entries in the image list yet')).toBeVisible();
8787
await createImageWithPlate(page, '/tmp/invalid', 'plate1');
8888
await checkPlateSelector(page, 'plate1');
8989
await page.getByRole('combobox', { name: 'Select plate' }).selectOption('plate1');

0 commit comments

Comments
 (0)