tests(e2e): improve coverage

This commit is contained in:
Lucas Nogueira
2026-09-22 21:54:21 -03:00
parent 684feb2510
commit c8c373b48b
50 changed files with 1893 additions and 183 deletions
+40
View File
@@ -0,0 +1,40 @@
<script>
import {
moveWindow,
moveWindowConstrained,
Position
} from '@tauri-apps/plugin-positioner'
export let onMessage
// `Position` is a numeric enum, so it also maps the values back to their names
const positions = Object.keys(Position).filter((key) => isNaN(Number(key)))
let position = 'Center'
let constrained = false
function move() {
;(constrained ? moveWindowConstrained : moveWindow)(Position[position])
.then(() => onMessage(`Moved the window to ${position}`))
.catch(onMessage)
}
</script>
<div class="flex flex-col gap-2">
<p>
The tray positions only resolve once the tray icon has been clicked, which
reports its location to the plugin.
</p>
<div class="flex flex-row gap-2 items-center">
<select class="input" bind:value={position}>
{#each positions as name}
<option value={name}>{name}</option>
{/each}
</select>
<label>
<input type="checkbox" bind:checked={constrained} />
Constrain to the tray icon's monitor
</label>
<button class="btn" on:click={move}>Move window</button>
</div>
</div>