Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
fix: send language on register (#321)
Browse files Browse the repository at this point in the history
* fix: send lanaguage to backend on register

* fix: update intercept

* fix: update successContent test
  • Loading branch information
spaenleh authored Mar 12, 2024
1 parent 5010dc7 commit 54c17a9
Show file tree
Hide file tree
Showing 8 changed files with 280 additions and 196 deletions.
324 changes: 162 additions & 162 deletions .yarn/releases/yarn-4.1.0.cjs → .yarn/releases/yarn-4.1.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.1.0.cjs
yarnPath: .yarn/releases/yarn-4.1.1.cjs
2 changes: 1 addition & 1 deletion cypress/e2e/SignUp.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Name and Email Validation', () => {
cy.visit(SIGN_UP_PATH);

// eslint-disable-next-line arrow-body-style
cy.intercept(API_ROUTES.SIGN_UP_ROUTE, ({ reply }) => {
cy.intercept({ method: 'post', pathname: '/register' }, ({ reply }) => {
return reply({
statusCode: StatusCodes.NO_CONTENT,
});
Expand Down
17 changes: 6 additions & 11 deletions cypress/e2e/SuccessContent.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,16 @@ describe('Success Content', () => {
});

describe('Sign Up', () => {
it('Back Button', () => {
const { GRAASP, GRAASP_OTHER } = MEMBERS;
cy.visit(SIGN_UP_PATH);

cy.intercept(API_ROUTES.SIGN_UP_ROUTE, ({ reply }) => {
beforeEach(() => {
cy.intercept({ method: 'post', pathname: '/register' }, ({ reply }) => {
return reply({
statusCode: StatusCodes.NO_CONTENT,
});
});
});
it('Back Button', () => {
const { GRAASP, GRAASP_OTHER } = MEMBERS;
cy.visit(SIGN_UP_PATH);

cy.get(`#${SUCCESS_CONTENT_ID}`).should('not.exist');

Expand Down Expand Up @@ -128,12 +129,6 @@ describe('Success Content', () => {
const { GRAASP, GRAASP_OTHER } = MEMBERS;
cy.visit(SIGN_UP_PATH);

cy.intercept(API_ROUTES.SIGN_UP_ROUTE, ({ reply }) => {
return reply({
statusCode: StatusCodes.NO_CONTENT,
});
});

// Signing up with a valid email
cy.signUpAndCheck(GRAASP_OTHER);
cy.get(`#${BACK_BUTTON_ID}`).click();
Expand Down
1 change: 1 addition & 0 deletions cypress/support/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const mockGetMember = (members) => {
},
).as('getMember');
};

export const mockGetMembers = (members) => {
cy.intercept(
{
Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/cache": "11.11.0",
"@emotion/react": "11.11.3",
"@emotion/styled": "11.11.0",
"@graasp/query-client": "2.7.1",
"@graasp/query-client": "2.9.1",
"@graasp/sdk": "4.1.0",
"@graasp/translations": "1.25.2",
"@graasp/ui": "4.8.3",
Expand Down Expand Up @@ -109,8 +109,5 @@
"vite-plugin-checker": "0.6.4",
"vite-plugin-istanbul": "5.0.0"
},
"resolutions": {
"@graasp/query-client": "github:graasp/graasp-query-client#use-conditional-export"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]"
}
4 changes: 3 additions & 1 deletion src/components/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const { SIGN_IN_LINK_TEXT, SIGN_UP_BUTTON, SIGN_UP_HEADER, NAME_FIELD_LABEL } =
AUTH;

const SignUp = () => {
const { t } = useAuthTranslation();
const { t, i18n } = useAuthTranslation();
const { executeCaptcha } = useRecaptcha();

const { isMobile, challenge } = useMobileAppLogin();
Expand Down Expand Up @@ -95,12 +95,14 @@ const SignUp = () => {
email: lowercaseEmail,
captcha: token,
challenge,
lang: i18n.language,
})
: signUp({
name: name.trim(),
email: lowercaseEmail,
captcha: token,
url: redirect.url,
lang: i18n.language,
}));
setSuccessView(true);
}
Expand Down
119 changes: 104 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2816,21 +2816,20 @@ __metadata:
languageName: node
linkType: hard

"@graasp/query-client@github:graasp/graasp-query-client#use-conditional-export":
version: 2.7.0
resolution: "@graasp/query-client@https://github.com/graasp/graasp-query-client.git#commit=4d4acb35bf7f42770c1c56a76ccb3417ebe3070d"
"@graasp/query-client@npm:2.9.1":
version: 2.9.1
resolution: "@graasp/query-client@npm:2.9.1"
dependencies:
"@tanstack/react-query": "npm:4.36.1"
"@tanstack/react-query-devtools": "npm:4.36.1"
axios: "npm:1.6.7"
crypto-js: "npm:4.2.0"
http-status-codes: "npm:2.3.0"
qs: "npm:6.11.2"
qs: "npm:6.12.0"
peerDependencies:
"@graasp/sdk": ^4.0.0
"@graasp/translations": ^1.23.0
react: ^18.0.0
checksum: 10/bf0993f46240aab753ae98d9f966a0acd1ab8e896ac11dc29f7a997fe5217d3cc1b46de13358b17f5dd0816c6b79d28a1ddfeb60253726922529920234e6140f
checksum: 10/a8368b4b2c6500f35d112680811ee7fc683f1abae0cb561e3f3a2c27bb405a1dc0bc0dbf47a54b24fdb0a0a1b94ca07ae52c43426e4292453b44f1dbe0a7b2a4
languageName: node
linkType: hard

Expand Down Expand Up @@ -5686,6 +5685,19 @@ __metadata:
languageName: node
linkType: hard

"call-bind@npm:^1.0.7":
version: 1.0.7
resolution: "call-bind@npm:1.0.7"
dependencies:
es-define-property: "npm:^1.0.0"
es-errors: "npm:^1.3.0"
function-bind: "npm:^1.1.2"
get-intrinsic: "npm:^1.2.4"
set-function-length: "npm:^1.2.1"
checksum: 10/cd6fe658e007af80985da5185bff7b55e12ef4c2b6f41829a26ed1eef254b1f1c12e3dfd5b2b068c6ba8b86aba62390842d81752e67dcbaec4f6f76e7113b6b7
languageName: node
linkType: hard

"callsites@npm:^3.0.0":
version: 3.1.0
resolution: "callsites@npm:3.1.0"
Expand Down Expand Up @@ -6457,13 +6469,6 @@ __metadata:
languageName: node
linkType: hard

"crypto-js@npm:4.2.0":
version: 4.2.0
resolution: "crypto-js@npm:4.2.0"
checksum: 10/c7bcc56a6e01c3c397e95aa4a74e4241321f04677f9a618a8f48a63b5781617248afb9adb0629824792e7ec20ca0d4241a49b6b2938ae6f973ec4efc5c53c924
languageName: node
linkType: hard

"css.escape@npm:^1.5.1":
version: 1.5.1
resolution: "css.escape@npm:1.5.1"
Expand Down Expand Up @@ -6732,6 +6737,17 @@ __metadata:
languageName: node
linkType: hard

"define-data-property@npm:^1.1.4":
version: 1.1.4
resolution: "define-data-property@npm:1.1.4"
dependencies:
es-define-property: "npm:^1.0.0"
es-errors: "npm:^1.3.0"
gopd: "npm:^1.0.1"
checksum: 10/abdcb2505d80a53524ba871273e5da75e77e52af9e15b3aa65d8aad82b8a3a424dad7aee2cc0b71470ac7acf501e08defac362e8b6a73cdb4309f028061df4ae
languageName: node
linkType: hard

"define-lazy-prop@npm:^2.0.0":
version: 2.0.0
resolution: "define-lazy-prop@npm:2.0.0"
Expand Down Expand Up @@ -7062,6 +7078,22 @@ __metadata:
languageName: node
linkType: hard

"es-define-property@npm:^1.0.0":
version: 1.0.0
resolution: "es-define-property@npm:1.0.0"
dependencies:
get-intrinsic: "npm:^1.2.4"
checksum: 10/f66ece0a887b6dca71848fa71f70461357c0e4e7249696f81bad0a1f347eed7b31262af4a29f5d726dc026426f085483b6b90301855e647aa8e21936f07293c6
languageName: node
linkType: hard

"es-errors@npm:^1.3.0":
version: 1.3.0
resolution: "es-errors@npm:1.3.0"
checksum: 10/96e65d640156f91b707517e8cdc454dd7d47c32833aa3e85d79f24f9eb7ea85f39b63e36216ef0114996581969b59fe609a94e30316b08f5f4df1d44134cf8d5
languageName: node
linkType: hard

"es-get-iterator@npm:^1.1.3":
version: 1.1.3
resolution: "es-get-iterator@npm:1.1.3"
Expand Down Expand Up @@ -8287,6 +8319,19 @@ __metadata:
languageName: node
linkType: hard

"get-intrinsic@npm:^1.2.4":
version: 1.2.4
resolution: "get-intrinsic@npm:1.2.4"
dependencies:
es-errors: "npm:^1.3.0"
function-bind: "npm:^1.1.2"
has-proto: "npm:^1.0.1"
has-symbols: "npm:^1.0.3"
hasown: "npm:^2.0.0"
checksum: 10/85bbf4b234c3940edf8a41f4ecbd4e25ce78e5e6ad4e24ca2f77037d983b9ef943fd72f00f3ee97a49ec622a506b67db49c36246150377efcda1c9eb03e5f06d
languageName: node
linkType: hard

"get-package-type@npm:^0.1.0":
version: 0.1.0
resolution: "get-package-type@npm:0.1.0"
Expand Down Expand Up @@ -8554,7 +8599,7 @@ __metadata:
"@emotion/cache": "npm:11.11.0"
"@emotion/react": "npm:11.11.3"
"@emotion/styled": "npm:11.11.0"
"@graasp/query-client": "npm:2.7.1"
"@graasp/query-client": "npm:2.9.1"
"@graasp/sdk": "npm:4.1.0"
"@graasp/translations": "npm:1.25.2"
"@graasp/ui": "npm:4.8.3"
Expand Down Expand Up @@ -8676,6 +8721,15 @@ __metadata:
languageName: node
linkType: hard

"has-property-descriptors@npm:^1.0.2":
version: 1.0.2
resolution: "has-property-descriptors@npm:1.0.2"
dependencies:
es-define-property: "npm:^1.0.0"
checksum: 10/2d8c9ab8cebb572e3362f7d06139a4592105983d4317e68f7adba320fe6ddfc8874581e0971e899e633fd5f72e262830edce36d5a0bc863dad17ad20572484b2
languageName: node
linkType: hard

"has-proto@npm:^1.0.1":
version: 1.0.1
resolution: "has-proto@npm:1.0.1"
Expand Down Expand Up @@ -11381,7 +11435,16 @@ __metadata:
languageName: node
linkType: hard

"qs@npm:6.11.2, qs@npm:^6.10.0":
"qs@npm:6.12.0":
version: 6.12.0
resolution: "qs@npm:6.12.0"
dependencies:
side-channel: "npm:^1.0.6"
checksum: 10/6156d3f0d74278b7e93a3a6b56e6b87b513ebd45ae65c7330c96d70270d0844fb0af9454a194124cd56b9ebf47b456dd01e28b223cde93c8ab01d1cb53a0e491
languageName: node
linkType: hard

"qs@npm:^6.10.0":
version: 6.11.2
resolution: "qs@npm:6.11.2"
dependencies:
Expand Down Expand Up @@ -12317,6 +12380,20 @@ __metadata:
languageName: node
linkType: hard

"set-function-length@npm:^1.2.1":
version: 1.2.2
resolution: "set-function-length@npm:1.2.2"
dependencies:
define-data-property: "npm:^1.1.4"
es-errors: "npm:^1.3.0"
function-bind: "npm:^1.1.2"
get-intrinsic: "npm:^1.2.4"
gopd: "npm:^1.0.1"
has-property-descriptors: "npm:^1.0.2"
checksum: 10/505d62b8e088468917ca4e3f8f39d0e29f9a563b97dbebf92f4bd2c3172ccfb3c5b8e4566d5fcd00784a00433900e7cb8fbc404e2dbd8c3818ba05bb9d4a8a6d
languageName: node
linkType: hard

"set-function-name@npm:^2.0.0, set-function-name@npm:^2.0.1":
version: 2.0.1
resolution: "set-function-name@npm:2.0.1"
Expand Down Expand Up @@ -12369,6 +12446,18 @@ __metadata:
languageName: node
linkType: hard

"side-channel@npm:^1.0.6":
version: 1.0.6
resolution: "side-channel@npm:1.0.6"
dependencies:
call-bind: "npm:^1.0.7"
es-errors: "npm:^1.3.0"
get-intrinsic: "npm:^1.2.4"
object-inspect: "npm:^1.13.1"
checksum: 10/eb10944f38cebad8ad643dd02657592fa41273ce15b8bfa928d3291aff2d30c20ff777cfe908f76ccc4551ace2d1245822fdc576657cce40e9066c638ca8fa4d
languageName: node
linkType: hard

"siginfo@npm:^2.0.0":
version: 2.0.0
resolution: "siginfo@npm:2.0.0"
Expand Down

0 comments on commit 54c17a9

Please sign in to comment.