mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
test(core): test case for dragging from bs editor to sidebar (#9057)
fix AF-1904
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
|
||||
export function getCurrentDocIdFromUrl(page: Page) {
|
||||
const pathname = new URL(page.url()).pathname;
|
||||
export function getDocIdFromUrl(url: string) {
|
||||
const pathname = new URL(url).pathname;
|
||||
|
||||
const match = pathname.match(/\/workspace\/([^/]+)\/([^/]+)\/?/);
|
||||
if (match && match[2]) {
|
||||
return match[2];
|
||||
@@ -9,6 +10,10 @@ export function getCurrentDocIdFromUrl(page: Page) {
|
||||
throw new Error('Failed to get doc id from url');
|
||||
}
|
||||
|
||||
export function getCurrentDocIdFromUrl(page: Page) {
|
||||
return getDocIdFromUrl(page.url());
|
||||
}
|
||||
|
||||
export function getCurrentCollectionIdFromUrl(page: Page) {
|
||||
const pathname = new URL(page.url()).pathname;
|
||||
const match = pathname.match(/\/workspace\/([^/]+)\/collection\/([^/]+)\/?/);
|
||||
|
||||
Reference in New Issue
Block a user