mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-11-15 20:50:12 +00:00
test: verify P2P progress and native cleanup in Obsidian
Check diagnostic disclosure, responsive peer controls, and current-connection document counters after normal bidirectional synchronisation. Verify that the native API cleanup callback runs once through normal and failed unload. Retain the existing Fetch, recovery, data-preservation, and reload checks, and describe the native scenarios in the E2E guide.
This commit is contained in:
1 parent
b64568aff4
commit
a5d3769cc1
4 files changed
+156
-3
No files matched your search
@@ -180,6 +180,23 @@ async function verifyP2PStatusPane(filename: string, mobile: boolean): Promise<s
|
||||
"xpath=ancestor::*[contains(concat(' ', normalize-space(@class), ' '), ' workspace-leaf-content ')][1]"
|
||||
);
|
||||
await pane.getByText("Connection:", { exact: true }).waitFor({ state: "visible", timeout: uiTimeoutMs });
|
||||
const refresh = pane.getByRole("button", { name: "Refresh", exact: true });
|
||||
await refresh.waitFor({ state: "visible", timeout: uiTimeoutMs });
|
||||
if (mobile) {
|
||||
const touchTarget = await refresh.evaluate((element) => {
|
||||
const rect = element.getBoundingClientRect();
|
||||
return {
|
||||
width: rect.width,
|
||||
height: rect.height,
|
||||
rootFontSize: getComputedStyle(document.documentElement).fontSize,
|
||||
};
|
||||
});
|
||||
if (touchTarget.width < 44 || touchTarget.height < 44) {
|
||||
throw new Error(
|
||||
`The mobile P2P Refresh touch target was smaller than 44 CSS pixels at the default font: ${JSON.stringify(touchTarget)}`
|
||||
);
|
||||
}
|
||||
}
|
||||
await pane.getByRole("button", { name: "Open connection" }).waitFor({
|
||||
state: "visible",
|
||||
timeout: uiTimeoutMs,
|
||||
|
||||
Reference in new issue
Block a user