Skip to content

Commit 0922106

Browse files
committed
Merge remote-tracking branch 'origin/release/v2.1.0'
2 parents 10a3904 + 1b2e977 commit 0922106

File tree

238 files changed

+5805
-4679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+5805
-4679
lines changed

.eslintrc.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040
'prefer-const': ['error'],
4141
semi: ['error', 'never'],
4242
'use-isnan': ['error'],
43-
'@typescript-eslint/array-type': ['error', 'array-simple'],
43+
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
4444
'@typescript-eslint/ban-types': [
4545
'error',
4646
{
@@ -54,22 +54,27 @@ module.exports = {
5454
],
5555
'react/jsx-uses-vars': ['warn'],
5656
// PascalCase for classes
57-
'@typescript-eslint/class-name-casing': ['error'],
57+
'@typescript-eslint/class-name-casing': ['off'],
5858
// don't prefix interface names with 'I'
59-
'@typescript-eslint/interface-name-prefix': ['error', 'never'],
59+
'@typescript-eslint/interface-name-prefix': ['off'],
6060
// don't conflict <Types> and JSX
61-
'@typescript-eslint/no-angle-bracket-type-assertion': ['error'],
61+
'@typescript-eslint/no-angle-bracket-type-assertion': ['off'],
6262
// lose out on typing benefits with any
6363
'@typescript-eslint/no-explicit-any': ['error'],
6464
'@typescript-eslint/no-empty-interface': ['off'],
6565
'@typescript-eslint/no-inferrable-types': ['error'],
6666
// namespaces and modules are outdated, use ES6 style
6767
'@typescript-eslint/no-namespace': ['error'],
6868
// use ES6-style imports instead
69-
'@typescript-eslint/no-triple-slash-reference': ['error'],
69+
'@typescript-eslint/no-triple-slash-reference': ['off'],
7070
'@typescript-eslint/no-var-requires': ['off'],
7171
'@typescript-eslint/no-use-before-define': ['off'],
7272
'@typescript-eslint/explicit-function-return-type': ['off'],
73-
'import/no-duplicates': ['error'],
73+
'import/no-duplicates': ['off'],
7474
},
75+
ignorePatterns: [
76+
'package.json',
77+
'jest.config.js',
78+
'app.json',
79+
],
7580
}

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [10.x]
11+
node-version: [12.x]
1212

1313
steps:
1414
- uses: actions/checkout@v2

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ appcenter-secrets
77
report.xml
88
.bundle/
99
vendor/
10+
poeditor-key/
1011

1112
# App connect keys
1213
app-store-connect-auth

.prettierrc.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module.exports = {
2-
endOfLine: 'lf',
32
semi: false,
43
singleQuote: true,
54
tabWidth: 2,
65
trailingComma: 'all',
7-
};
6+
}

App.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { SafeAreaProvider } from 'react-native-safe-area-context'
77
import { I18nextProvider } from 'react-i18next'
88

99
import RootNavigation from '~/RootNavigation'
10-
import { ErrorBoundary } from '~/errors/ErrorBoundary'
10+
import ErrorBoundary from '~/errors/ErrorBoundary'
1111
import { AgentContextProvider } from '~/utils/sdk/context'
1212
import configureStore from './configureStore'
1313
import Overlays from '~/Overlays'
@@ -28,8 +28,8 @@ const App = () => {
2828

2929
return (
3030
<SafeAreaProvider>
31-
<I18nextProvider i18n={i18n}>
32-
<Provider store={store}>
31+
<Provider store={store}>
32+
<I18nextProvider i18n={i18n}>
3333
<ErrorContextProvider>
3434
<ErrorBoundary>
3535
<AgentContextProvider>
@@ -38,8 +38,8 @@ const App = () => {
3838
</AgentContextProvider>
3939
</ErrorBoundary>
4040
</ErrorContextProvider>
41-
</Provider>
42-
</I18nextProvider>
41+
</I18nextProvider>
42+
</Provider>
4343
</SafeAreaProvider>
4444
)
4545
}

LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright 2014-2021 Jolocom GmbH

__tests__/mocks/agent.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const mockedAgent = {
2+
passwordStore: {
3+
getPassword: jest.fn().mockResolvedValue(true),
4+
},
5+
}

__tests__/mocks/documents.ts

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
export const mockedDocuments = {
2+
documents: [
3+
{
4+
id: 'abscbajhfjdhfjdshfsdjhfa',
5+
type: 'document',
6+
claim: {
7+
id: 'id1',
8+
message: 'message1',
9+
},
10+
metadata: {
11+
name: 'Document 1',
12+
},
13+
issuer: {
14+
did: 'did:jun:example',
15+
},
16+
},
17+
{
18+
id: 'dsfjsjdfjhdfasjdhfasdhjfajsdhf',
19+
type: 'document 2',
20+
claim: {
21+
id: 'id2',
22+
message: 'message2',
23+
},
24+
metadata: {
25+
name: 'Document 2',
26+
},
27+
issuer: {
28+
did: 'did:jun:example',
29+
publicProfile: {
30+
name: 'Issuer name',
31+
description: 'I am the issuer',
32+
},
33+
},
34+
},
35+
],
36+
other: [
37+
{
38+
id: 'adfdjfahdfahdfajsdhf dfye',
39+
type: 'other',
40+
claim: {
41+
id: 'id3',
42+
message: 'message3',
43+
},
44+
metadata: {
45+
name: 'Document 3',
46+
},
47+
issuer: {
48+
did: 'did:jun:example',
49+
publicProfile: {
50+
name: 'Issuer name',
51+
description: 'I am the issuer',
52+
},
53+
},
54+
},
55+
],
56+
}
57+
58+
export const mockedFields = [
59+
{
60+
id: 1,
61+
type: 'document',
62+
details: {
63+
mandatoryFields: [
64+
{ label: 'givenName', value: 'Test Given Name' },
65+
{ label: 'Document Name', value: 'some doc' },
66+
],
67+
optionalFields: [{ label: 'c', value: 'd' }],
68+
},
69+
},
70+
{
71+
id: 2,
72+
type: 'other',
73+
details: {
74+
mandatoryFields: [{ label: 'givenName', value: 'f' }],
75+
optionalFields: [{ label: 'g', value: 'h' }],
76+
},
77+
},
78+
]

__tests__/mocks/libs/react-redux.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import * as rredux from 'react-redux'
2+
3+
type MockedStore = Record<string, string> | MockedStore
4+
5+
export function mockSelectorReturn(mockedStore: MockedStore) {
6+
// @ts-expect-error
7+
rredux.useSelector.mockImplementation((callback: (state: any) => void) =>
8+
callback(mockedStore),
9+
)
10+
}
11+
12+
export const getMockedDispatch = () => {
13+
const mockDispatchFn = jest.fn()
14+
const useDispatchSpy = jest.spyOn(rredux, 'useDispatch')
15+
useDispatchSpy.mockReturnValue(mockDispatchFn)
16+
return mockDispatchFn
17+
}

__tests__/mocks/react-native-safe-area-context.js

-13
This file was deleted.

__tests__/mocks/store/attributes.ts

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export const mockedNoAttributes = {
2+
account: { did: 'did-1' },
3+
toasts: { active: null },
4+
attrs: {
5+
all: {},
6+
},
7+
}
8+
9+
export const mockedAttributes = {
10+
attrs: {
11+
all: {
12+
ProofOfEmailCredential: [
13+
{ id: 'claimId', value: { givenName: 'Karl', familyName: 'Muller' } },
14+
],
15+
},
16+
},
17+
}
18+
19+
export const getMockedEmailAttribute = (
20+
attrId1: string,
21+
attrId2: string,
22+
email1: string,
23+
email2: string,
24+
) => ({
25+
attrs: {
26+
all: {
27+
ProofOfEmailCredential: [
28+
{ id: attrId1, value: { email: email1 } },
29+
{ id: attrId2, value: { email: email2 } },
30+
],
31+
},
32+
},
33+
})

0 commit comments

Comments
 (0)