-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add simple test to make
yarn test
pass
`yarn test` requires at least one test to pass but we removed all tests that were related to Search
- Loading branch information
Showing
6 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
import '@testing-library/jest-dom'; | ||
import 'cross-fetch/polyfill'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import CozyClient from 'cozy-client' | ||
import PouchLink from 'cozy-pouch-link' | ||
import { LinkPlatform } from 'cozy-pouch-link/types/types' | ||
|
||
import { getPouchLink } from '@/helpers/client' | ||
|
||
test('should retrieve PouchLink from client', () => { | ||
const pouchLinkOptions = { | ||
doctypes: ['io.cozy.files'], | ||
initialSync: true, | ||
periodicSync: false, | ||
platform: {} as LinkPlatform, | ||
doctypesReplicationOptions: { | ||
'io.cozy.files': { | ||
strategy: 'fromRemote' | ||
} | ||
} | ||
} | ||
const pouchLink = new PouchLink(pouchLinkOptions) | ||
const client = new CozyClient({ | ||
links: [pouchLink] | ||
}) | ||
|
||
const result = getPouchLink(client) | ||
|
||
expect(result).toBe(pouchLink) | ||
}) | ||
|
||
test('should return null if no client', () => { | ||
const result = getPouchLink(undefined) | ||
|
||
expect(result).toBe(null) | ||
}) | ||
|
||
test('should return null if no PouchLink found', () => { | ||
const client = new CozyClient() | ||
|
||
const result = getPouchLink(client) | ||
|
||
expect(result).toBe(null) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2382,6 +2382,13 @@ create-require@^1.1.0: | |
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" | ||
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== | ||
|
||
cross-fetch@^4.0.0: | ||
version "4.0.0" | ||
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-4.0.0.tgz#f037aef1580bb3a1a35164ea2a848ba81b445983" | ||
integrity sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g== | ||
dependencies: | ||
node-fetch "^2.6.12" | ||
|
||
cross-spawn@^6.0.5: | ||
version "6.0.5" | ||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" | ||
|
@@ -4807,7 +4814,7 @@ [email protected]: | |
dependencies: | ||
whatwg-url "^5.0.0" | ||
|
||
node-fetch@^2.6.1: | ||
node-fetch@^2.6.1, node-fetch@^2.6.12: | ||
version "2.7.0" | ||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" | ||
integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== | ||
|