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,46 @@
// 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 { tauriError, describePlugin } from '../helpers/index.js'
// A successful open launches an external application (browser, file manager)
// the suite cannot control or close, so only the scope enforcement is covered.
// The example allows `mailto:`, `tel:`, `http(s)://` URLs (opener:default),
// `https://` URLs specifically with `inAppBrowser`, and paths under `$APPDATA`.
describePlugin('opener', () => {
it('openUrl rejects URL schemes outside the scope', async () => {
const message = await tauriError((api) =>
api.opener.openUrl('ftp://example.com/file')
)
expect(message).toMatch(
/Not allowed to open url ftp:\/\/example\.com\/file/
)
})
it('openUrl rejects an app that is not in the scope for the URL', async () => {
// `inAppBrowser` is only allowed for `https://` URLs
const message = await tauriError((api) =>
api.opener.openUrl('http://example.com', 'inAppBrowser')
)
expect(message).toMatch(/Not allowed to open url http:\/\/example\.com/)
})
it('openPath rejects paths outside the scope', async () => {
const message = await tauriError(async (api) =>
api.opener.openPath(await api.path.join(await api.path.homeDir(), 'e2e'))
)
expect(message).toMatch(/Not allowed to open path/)
})
it('revealItemInDir rejects paths that do not exist', async () => {
const message = await tauriError(async (api) =>
api.opener.revealItemInDir(
await api.path.join(await api.path.appDataDir(), 'does-not-exist-e2e')
)
)
expect(message).toMatch(/os error 2/)
})
})