snapshot of https://github.com/tauri-apps/plugins-workspace.git (v2, 2026-09-23; blobs > 131072B omitted)
Some checks failed
integration tests / run-integration-tests (windows-latest) (push) Has been cancelled
Test Rust / test (push) Has been cancelled
test plugins e2e (mobile) / ios (push) Has been cancelled
test plugins e2e / test (map[name:Windows os:windows-latest]) (push) Has been cancelled
test plugins e2e / test (map[name:macOS os:macos-latest]) (push) Has been cancelled
integration tests / run-integration-tests (macos-latest) (push) Has been cancelled
version or publish / version-or-publish (push) Failing after 0s
integration tests / run-integration-tests (ubuntu-22.04) (push) Failing after 0s
Lint JavaScript / eslint (push) Failing after 0s
Sync / sync-to-mirrors (push) Failing after 0s
test plugins e2e (mobile) / android (push) Failing after 0s
test plugins e2e / test (map[name:Linux os:ubuntu-latest]) (push) Failing after 0s
Test Rust / changes (push) Failing after 0s
Lint Rust / changes (push) Failing after 0s
Lint Rust / clippy (push) Has been skipped
Audit Rust / audit-rust (push) Failing after 1s
Audit JavaScript / audit-js (push) Failing after 1s

This commit is contained in:
upstream-mirror
2026-09-23 17:17:10 +05:00
commit 9ad64ec987
1469 changed files with 115067 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { expect } from '@wdio/globals'
import { tauri, describePlugin } from '../helpers/index.js'
// Enabling autostart registers the app with the host for real (a Launch Agent
// on macOS, an XDG autostart entry on Linux, a `Run` registry value on
// Windows), so the spec puts back whatever state it found.
describePlugin('autostart', { desktopOnly: true }, () => {
let initiallyEnabled = false
before(async () => {
initiallyEnabled = await tauri((api) => api.autostart.isEnabled())
})
after(async () => {
await tauri(
(api, enabled) =>
enabled ? api.autostart.enable() : api.autostart.disable(),
initiallyEnabled
)
})
it('enable and disable toggle isEnabled', async () => {
const states = await tauri(async (api) => {
await api.autostart.enable()
const enabled = await api.autostart.isEnabled()
await api.autostart.disable()
return { enabled, disabled: await api.autostart.isEnabled() }
})
expect(states).toEqual({ enabled: true, disabled: false })
})
it('enabling twice keeps it enabled', async () => {
const enabled = await tauri(async (api) => {
await api.autostart.enable()
await api.autostart.enable()
const enabled = await api.autostart.isEnabled()
await api.autostart.disable()
return enabled
})
expect(enabled).toBe(true)
})
it('disable resolves when autostart is already disabled', async () => {
// Windows used to fail here, having no `Run` registry value to delete
const disabled = await tauri(async (api) => {
await api.autostart.enable()
await api.autostart.disable()
await api.autostart.disable()
return !(await api.autostart.isEnabled())
})
expect(disabled).toBe(true)
})
})