Skip to content

Commit

Permalink
e2e: strict query selector
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Patil <[email protected]>
  • Loading branch information
pulsejet committed Jan 4, 2025
1 parent 505911d commit e2cebf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion e2e/folders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test.describe('Open', () => {
await page.locator('tr[data-filename="Photos"]').click();

// Action button
await page.locator('.dialog button[aria-label^="Move"]').click();
await page.locator('.dialog button[aria-label="Move"]').click();
await page.waitForTimeout(2000);

// Check if the file is moved
Expand Down
13 changes: 4 additions & 9 deletions src/services/utils/dialog.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import type { IFilePickerButton } from '@nextcloud/dialogs';
import { getFilePickerBuilder, showError } from '@nextcloud/dialogs';
import type { Node } from '@nextcloud/files';

import { translatePlural as n, translate as t } from '@services/l10n';
import { bus } from './event-bus';
import { fragment } from './fragment';

import type { Node } from '@nextcloud/files';
import type { IFilePickerButton } from '@nextcloud/dialogs';

// https://github.com/nextcloud/server/blob/4b7ec0a0c18d4e2007565dc28ee214814940161e/core/src/OC/dialogs.js
const oc_dialogs = (<any>OC).dialogs;

type IFilePickerButtonFactory = (
selectedNodes: Node[],
currentPath: string,
currentView: string,
) => IFilePickerButton[];

type ConfirmOptions = {
/** Title of dialog */
title?: string;
Expand Down Expand Up @@ -181,7 +176,7 @@ function chooseButtonFactory(nodes: Node[]): IFilePickerButton[] {
export async function chooseNcFolder(
title: string,
initial: string = '/',
buttonFactory: IFilePickerButtonFactory = chooseButtonFactory,
buttonFactory = chooseButtonFactory,
): Promise<string> {
const picker = getFilePickerBuilder(title)
.setMultiSelect(false)
Expand Down

0 comments on commit e2cebf2

Please sign in to comment.