Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/139 external user #161

Merged
merged 38 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
51b71a0
add build to CI
theblockstalk Mar 7, 2023
c18b3c7
external user class definition
theblockstalk Mar 7, 2023
c22a032
Moved loginWithTonomy to ExternalUser class
theblockstalk Mar 7, 2023
8c64301
first part of external user test
theblockstalk Mar 7, 2023
b65a467
continue to create external user tests
theblockstalk Mar 7, 2023
172d410
nearly finished the test
theblockstalk Mar 8, 2023
10cf18d
sleep function
theblockstalk Mar 8, 2023
e5a58fb
finished draft of integration test
theblockstalk Mar 8, 2023
4dba215
Instructions for running tests
theblockstalk Mar 8, 2023
4cf05a1
settings for jest runner
theblockstalk Mar 8, 2023
49d4b9e
add communication to settings
theblockstalk Mar 8, 2023
c8abf5e
abstractions in Communication
theblockstalk Mar 8, 2023
a263708
fixed issue with connect()
theblockstalk Mar 8, 2023
f997715
fixed communication url in settings, JSDoc, fixed double emit and res…
theblockstalk Mar 9, 2023
eaa1232
external user tests
theblockstalk Mar 9, 2023
2f5506e
creating random apps and subscriber
theblockstalk Mar 9, 2023
4db2676
running emulator for window.location.origin and localStorage
theblockstalk Mar 9, 2023
72ba444
revert back to before. use same custom test env for test and integration
theblockstalk Mar 9, 2023
c1e68f1
updated jest.config to be inside ./test dir
theblockstalk Mar 9, 2023
1eec6f3
updated integration to use same config as test
theblockstalk Mar 9, 2023
baae1d5
removed global.d.ts files
theblockstalk Mar 9, 2023
041d51f
testing out new config for jest
theblockstalk Mar 9, 2023
b87ac65
all tests passing
theblockstalk Mar 9, 2023
b1a8220
fixed bug with createRandomApp
theblockstalk Mar 10, 2023
accfde4
more of the test suite passing
theblockstalk Mar 10, 2023
29311ab
receiving the requests partially working
theblockstalk Mar 10, 2023
0c0a266
receiving and verifying requests in test
theblockstalk Mar 10, 2023
8796b41
flow working, but test doesnt finish execution
theblockstalk Mar 13, 2023
a297776
added types to variables and logging
theblockstalk Mar 13, 2023
4195d5f
fixed tests by turning off forced exit
theblockstalk Mar 13, 2023
0e5bbff
fixed test
theblockstalk Mar 14, 2023
67bd712
check assertion count
theblockstalk Mar 14, 2023
245a2a1
ensure all code executes
theblockstalk Mar 14, 2023
7def4f7
Merge branch 'development' into feature/139-external-user
theblockstalk Mar 14, 2023
1b034f7
removed unused comments and jest config
theblockstalk Mar 14, 2023
985d23f
updated documents
theblockstalk Mar 14, 2023
5382e62
removed other jest unused files and code
theblockstalk Mar 14, 2023
2d62a1d
added ExternalUser to exports
theblockstalk Mar 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ jobs:
with:
node-version: 16.4.1
- run: npm install
- run: npm run build
- run: npm run lint
- run: npm test
- run: npm run test

compile-contracts:
name: Compiles contracts needed for bootstrap script
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"recommendations": [
"DavidAnson.vscode-markdownlint",
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"streetsidesoftware.code-spell-checker"
]
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"cSpell.words": [
"tonomy"
]
}
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,19 @@ To do a one-off build, use `npm run build`.

## Tests

To run tests, use `npm test`.
### Unit tests:

To run integration tests `./test-integration/build-and-run-tests.sh`
Tests individual class and function logic within the SDK.

`npm test`

### Integration tests:

Tests end-to-end functions across more than one service.

Require another service to be running, such as the blockchain or Tonomy Communication service.

`./test-integration/build-and-run-tests.sh`

## Linting

Expand Down
2 changes: 1 addition & 1 deletion docs/login.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Login page
async function onButtonPress() {
setSettings({ ssoWebsiteOrigin: "https://tonomy-id-staging.tonomy.foundation" });

UserApps.onPressLogin({ callbackPath: '/callback' });
ExternalUser.loginWithTonomy({ callbackPath: '/callback' });
}

Callback page
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To use the SDK, first import it:
async function onButtonPress() {
setSettings({ ssoWebsiteOrigin: "https://tonomy-id-staging.tonomy.foundation" });

UserApps.onPressLogin({ callbackPath: '/callback' });
ExternalUser.loginWithTonomy({ callbackPath: '/callback' });
}

We can call the function ``onButtonPress()`` in the login implementation:
Expand Down
3 changes: 0 additions & 3 deletions jest.config.js

This file was deleted.

Loading