Skip to content

Commit

Permalink
Merge branch 'main' into fix/ver-json5
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblanc committed Aug 8, 2023
2 parents 029bae1 + 115d96e commit 8bdc516
Show file tree
Hide file tree
Showing 31 changed files with 6,134 additions and 5,022 deletions.
4 changes: 4 additions & 0 deletions .github/canary-config/canary-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ tests:
sample_name: [related-models]
spec: related-models
browser: *minimal_browser_list
timeout_minutes: 45
retry_count: 10
- test_name: integ_react_datastore_selective_sync
desc: 'DataStore - Selective Sync'
framework: react
Expand Down Expand Up @@ -123,6 +125,8 @@ tests:
sample_name: [next-13-js]
spec: nextjs-13
browser: *minimal_browser_list
timeout_minutes: 45
retry_count: 10
- test_name: integ_rollup_datastore_basic_crud
desc: 'Rollup + DataStore - Basic CRUD'
framework: rollup
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/callable-canary-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,5 @@ jobs:
WEBHOOK_URL: ${{ env.WEBHOOK_URL }}
run: |
curl -X POST -H "Content-Type: application/json" \
--data '{"URL":"$WORKFLOW_URL"}' \
--data {URL:$WORKFLOW_URL} \
$WEBHOOK_URL
5 changes: 3 additions & 2 deletions .github/workflows/on-schedule-canary-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
on:
# Tests scheduled for every 1 hour
# Tests scheduled at 4pm(UTC) / 9am(PDT) everyday
# default supported timezone is UTC
schedule:
- cron: '0 */1 * * *'
- cron: '0 16 * * *'

jobs:
canaries:
Expand Down
1 change: 0 additions & 1 deletion packages/amazon-cognito-identity-js/.eslintignore

This file was deleted.

30 changes: 0 additions & 30 deletions packages/amazon-cognito-identity-js/.eslintrc.yaml

This file was deleted.

22 changes: 12 additions & 10 deletions packages/amazon-cognito-identity-js/__tests__/CognitoUser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ describe('authenticateUser()', () => {
user.setAuthenticationFlowType('USER_PASSWORD_AUTH');
user.authenticateUser(authDetails, callback);

expect(spyon).toHaveBeenCalledWith(authDetails, callback);
expect(spyon).toHaveBeenCalledWith(authDetails, callback, undefined);
});

test('USER_SRP_AUTH and CUSTOM_AUTH flow types', () => {
Expand All @@ -212,12 +212,12 @@ describe('authenticateUser()', () => {
user.setAuthenticationFlowType('USER_SRP_AUTH');
user.authenticateUser(authDetails, callback);

expect(spyon).toHaveBeenCalledWith(authDetails, callback);
expect(spyon).toHaveBeenCalledWith(authDetails, callback, undefined);

user.setAuthenticationFlowType('CUSTOM_AUTH');
user.authenticateUser(authDetails, callback);

expect(spyon).toHaveBeenCalledWith(authDetails, callback);
expect(spyon).toHaveBeenCalledWith(authDetails, callback, undefined);
});

test('throws error for invalid Authentication flow type', () => {
Expand Down Expand Up @@ -310,7 +310,8 @@ describe('authenticateUserPlainUsernamePassword()', () => {
expect(userSpy3).toBeCalledWith(
'test auth result',
userSpy3.mock.calls[0][1],
callback
callback,
undefined
);
expect(userSpy3.mock.results[0].value).toBe('test return value');
});
Expand Down Expand Up @@ -755,7 +756,8 @@ describe('sendCustomChallengeAnswer()', () => {
expect(spyon3).toBeCalledWith(
vCognitoUserSession,
expect.any(AuthenticationHelper),
callback
callback,
undefined
);
});

Expand Down Expand Up @@ -1176,33 +1178,33 @@ describe('confirmPassword() and forgotPassword()', () => {
jest.clearAllMocks();
});

test('happy path should callback onSuccess', () => {
test('confirmPassword happy path should callback onSuccess', () => {
netRequestMockSuccess(true);
cognitoUser.confirmPassword(...confirmPasswordDefaults);
expect(callback.onSuccess).toHaveBeenCalledWith('SUCCESS');
});

test('client request throws an error', () => {
test('confirmPassword client request throws an error', () => {
netRequestMockSuccess(false);
cognitoUser.confirmPassword(...confirmPasswordDefaults);
expect(callback.onFailure.mock.calls.length).toEqual(1);
});

test('happy path should callback onSuccess', () => {
test('forgotPassword happy path should callback onSuccess', () => {
callback.inputVerificationCode = null;
netRequestMockSuccess(true);
cognitoUser.forgotPassword(...forgotPasswordDefaults);
expect(callback.onSuccess.mock.calls.length).toEqual(1);
});

test('inputVerification code is a function should callback inputVerificationCode', () => {
test('forgotPassword inputVerification code is a function should callback inputVerificationCode', () => {
callback.inputVerificationCode = jest.fn();
netRequestMockSuccess(true);
cognitoUser.forgotPassword(...forgotPasswordDefaults);
expect(callback.inputVerificationCode.mock.calls.length).toEqual(1);
});

test('client returning an error should call onFailure', () => {
test('forgotPassword client returning an error should call onFailure', () => {
netRequestMockSuccess(false);
cognitoUser.forgotPassword(...forgotPasswordDefaults);
expect(callback.onFailure.mock.calls.length).toEqual(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe('import * keys', () => {
Array [
"addAuthCategoryToCognitoUserAgent",
"addFrameworkToCognitoUserAgent",
"InternalCognitoUser",
]
`);
});
Expand Down
15 changes: 2 additions & 13 deletions packages/amazon-cognito-identity-js/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8bdc516

Please sign in to comment.