Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/v2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
SBub committed Aug 13, 2021
2 parents 10a3904 + 1b2e977 commit 0922106
Show file tree
Hide file tree
Showing 238 changed files with 5,805 additions and 4,679 deletions.
17 changes: 11 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = {
'prefer-const': ['error'],
semi: ['error', 'never'],
'use-isnan': ['error'],
'@typescript-eslint/array-type': ['error', 'array-simple'],
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/ban-types': [
'error',
{
Expand All @@ -54,22 +54,27 @@ module.exports = {
],
'react/jsx-uses-vars': ['warn'],
// PascalCase for classes
'@typescript-eslint/class-name-casing': ['error'],
'@typescript-eslint/class-name-casing': ['off'],
// don't prefix interface names with 'I'
'@typescript-eslint/interface-name-prefix': ['error', 'never'],
'@typescript-eslint/interface-name-prefix': ['off'],
// don't conflict <Types> and JSX
'@typescript-eslint/no-angle-bracket-type-assertion': ['error'],
'@typescript-eslint/no-angle-bracket-type-assertion': ['off'],
// lose out on typing benefits with any
'@typescript-eslint/no-explicit-any': ['error'],
'@typescript-eslint/no-empty-interface': ['off'],
'@typescript-eslint/no-inferrable-types': ['error'],
// namespaces and modules are outdated, use ES6 style
'@typescript-eslint/no-namespace': ['error'],
// use ES6-style imports instead
'@typescript-eslint/no-triple-slash-reference': ['error'],
'@typescript-eslint/no-triple-slash-reference': ['off'],
'@typescript-eslint/no-var-requires': ['off'],
'@typescript-eslint/no-use-before-define': ['off'],
'@typescript-eslint/explicit-function-return-type': ['off'],
'import/no-duplicates': ['error'],
'import/no-duplicates': ['off'],
},
ignorePatterns: [
'package.json',
'jest.config.js',
'app.json',
],
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
node-version: [10.x]
node-version: [12.x]

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ appcenter-secrets
report.xml
.bundle/
vendor/
poeditor-key/

# App connect keys
app-store-connect-auth
Expand Down
3 changes: 1 addition & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = {
endOfLine: 'lf',
semi: false,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
};
}
10 changes: 5 additions & 5 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SafeAreaProvider } from 'react-native-safe-area-context'
import { I18nextProvider } from 'react-i18next'

import RootNavigation from '~/RootNavigation'
import { ErrorBoundary } from '~/errors/ErrorBoundary'
import ErrorBoundary from '~/errors/ErrorBoundary'
import { AgentContextProvider } from '~/utils/sdk/context'
import configureStore from './configureStore'
import Overlays from '~/Overlays'
Expand All @@ -28,8 +28,8 @@ const App = () => {

return (
<SafeAreaProvider>
<I18nextProvider i18n={i18n}>
<Provider store={store}>
<Provider store={store}>
<I18nextProvider i18n={i18n}>
<ErrorContextProvider>
<ErrorBoundary>
<AgentContextProvider>
Expand All @@ -38,8 +38,8 @@ const App = () => {
</AgentContextProvider>
</ErrorBoundary>
</ErrorContextProvider>
</Provider>
</I18nextProvider>
</I18nextProvider>
</Provider>
</SafeAreaProvider>
)
}
Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright 2014-2021 Jolocom GmbH
5 changes: 5 additions & 0 deletions __tests__/mocks/agent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const mockedAgent = {
passwordStore: {
getPassword: jest.fn().mockResolvedValue(true),
},
}
78 changes: 78 additions & 0 deletions __tests__/mocks/documents.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
export const mockedDocuments = {
documents: [
{
id: 'abscbajhfjdhfjdshfsdjhfa',
type: 'document',
claim: {
id: 'id1',
message: 'message1',
},
metadata: {
name: 'Document 1',
},
issuer: {
did: 'did:jun:example',
},
},
{
id: 'dsfjsjdfjhdfasjdhfasdhjfajsdhf',
type: 'document 2',
claim: {
id: 'id2',
message: 'message2',
},
metadata: {
name: 'Document 2',
},
issuer: {
did: 'did:jun:example',
publicProfile: {
name: 'Issuer name',
description: 'I am the issuer',
},
},
},
],
other: [
{
id: 'adfdjfahdfahdfajsdhf dfye',
type: 'other',
claim: {
id: 'id3',
message: 'message3',
},
metadata: {
name: 'Document 3',
},
issuer: {
did: 'did:jun:example',
publicProfile: {
name: 'Issuer name',
description: 'I am the issuer',
},
},
},
],
}

export const mockedFields = [
{
id: 1,
type: 'document',
details: {
mandatoryFields: [
{ label: 'givenName', value: 'Test Given Name' },
{ label: 'Document Name', value: 'some doc' },
],
optionalFields: [{ label: 'c', value: 'd' }],
},
},
{
id: 2,
type: 'other',
details: {
mandatoryFields: [{ label: 'givenName', value: 'f' }],
optionalFields: [{ label: 'g', value: 'h' }],
},
},
]
17 changes: 17 additions & 0 deletions __tests__/mocks/libs/react-redux.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as rredux from 'react-redux'

type MockedStore = Record<string, string> | MockedStore

export function mockSelectorReturn(mockedStore: MockedStore) {
// @ts-expect-error
rredux.useSelector.mockImplementation((callback: (state: any) => void) =>
callback(mockedStore),
)
}

export const getMockedDispatch = () => {
const mockDispatchFn = jest.fn()
const useDispatchSpy = jest.spyOn(rredux, 'useDispatch')
useDispatchSpy.mockReturnValue(mockDispatchFn)
return mockDispatchFn
}
13 changes: 0 additions & 13 deletions __tests__/mocks/react-native-safe-area-context.js

This file was deleted.

33 changes: 33 additions & 0 deletions __tests__/mocks/store/attributes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
export const mockedNoAttributes = {
account: { did: 'did-1' },
toasts: { active: null },
attrs: {
all: {},
},
}

export const mockedAttributes = {
attrs: {
all: {
ProofOfEmailCredential: [
{ id: 'claimId', value: { givenName: 'Karl', familyName: 'Muller' } },
],
},
},
}

export const getMockedEmailAttribute = (
attrId1: string,
attrId2: string,
email1: string,
email2: string,
) => ({
attrs: {
all: {
ProofOfEmailCredential: [
{ id: attrId1, value: { email: email1 } },
{ id: attrId2, value: { email: email2 } },
],
},
},
})
Loading

0 comments on commit 0922106

Please sign in to comment.