文件
mynode/packages/lib/utils/webDAVUtils.test.ts
chen 301194963b
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
feat: Initial clean release of CHM
2026-11-04 11:29:39 +08:00

44 行
2.1 KiB
TypeScript

import checkProviderIsSupported from './webDAVUtils';
import Setting from '../models/Setting';
describe('webDAVUtils', () => {
describe('when no unsupported provider is already configured', () => {
beforeAll(() => {
Setting.setValue('sync.allowUnsupportedProviders', 0);
});
it('should not throw when no provider path is provided ', () => {
expect(() => checkProviderIsSupported('')).not.toThrow();
});
it('should not throw when a valid provider path is provided', () => {
expect(() => checkProviderIsSupported('https://good-webdav-provider.com')).not.toThrow();
});
it('should not throw when a valid provider path with a name that contains an unsupported provider is provided', () => {
expect(() => checkProviderIsSupported('https://hopcloudabc.com')).not.toThrow();
});
it('should throw an error with the name of the provider when an unsupported provider path is provided', () => {
expect(() => checkProviderIsSupported('https://jianguoyun.com')).toThrowError('The WebDAV implementation of jianguoyun is incompatible with Joplin, and as such is no longer supported. Please use a different sync method.');
expect(() => checkProviderIsSupported('https://api.jianguoyun.com')).toThrowError('The WebDAV implementation of jianguoyun is incompatible with Joplin, and as such is no longer supported. Please use a different sync method.');
// expect(() => checkProviderIsSupported('https://api-pcloud-test.com')).toThrowError('The WebDAV implementation of pcloud is incompatible with Joplin, and as such is no longer supported. Please use a different sync method.');
});
// expect(() => checkProviderIsSupported('?param=pcloud')).toThrowError('The WebDAV implementation of pcloud is incompatible with Joplin, and as such is no longer supported. Please use a different sync method.');
});
describe('when an unsupported provider is already configured', () => {
beforeAll(() => {
Setting.setValue('sync.allowUnsupportedProviders', 1);
});
it('should not throw when an unsupported provider is already configured', () => {
expect(() => checkProviderIsSupported('pcloud')).not.toThrow();
});
});
});