obsidian-testing-framework/packages/test-project/e2e/example.spec.ts

23 lines
759 B
TypeScript
Raw Normal View History

2024-10-22 15:32:25 -04:00
import { expect } from '@playwright/test';
import {test} from "obsidian-testing-framework"
import {doWithApp, getApp} from "obsidian-testing-framework/utils";
test('something', async ({ page }) => {
console.log(page.url());
expect(/obsidian\.md/i.test(page.url())).toBeTruthy()
});
test("idk", async({page}) => {
console.log("idk")
let what = await doWithApp(page,async (app) => {
console.log("hi", Object.keys(app), (app.metadataCache));
let thing = app.metadataCache.getFirstLinkpathDest("Welcome", "/");
console.log("THING", thing);
await new Promise(res => setTimeout(res, 5000))
console.log(thing?.path);
const what = {...thing};
delete what.parent;
delete what.vault;
return what;
});
expect(what.basename).toEqual("Welcome")
})