Skip to content

Commit 2a08612

Browse files
committed
Fixed viewer path test; handled removal of viewer path error
1 parent 4c48b15 commit 2a08612

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/routes/v2/admin/groups/[groupId]/edit/+page.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@
138138
* @param {number} index
139139
*/
140140
function removeViewerPath(index) {
141+
if ($viewerPathsValidationErrors['viewer_paths']) {
142+
$viewerPathsValidationErrors['viewer_paths'] = $viewerPathsValidationErrors[
143+
'viewer_paths'
144+
].filter((_, i) => i !== index);
145+
}
141146
editableViewPaths = editableViewPaths.filter((_, i) => i !== index);
142147
}
143148

tests/v2/viewer_paths.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test('Viewer paths', async ({ page }) => {
5454
await addViewerPathBtn.click();
5555
const saveBtn = page.getByRole('button', { name: 'Save' }).first();
5656
await saveBtn.click();
57-
await expect(page.getByText('String should have at least 1 character')).toBeVisible();
57+
await expect(page.getByText('String should have at least 1 character').first()).toBeVisible();
5858
await page.getByLabel('Viewer path #1', { exact: true }).fill('/path/to/1');
5959
await page.getByLabel('Viewer path #2', { exact: true }).fill('/path/to/2');
6060
await saveBtn.click();

0 commit comments

Comments
 (0)