Skip to content

Commit 64c9c6e

Browse files
bolmstengithub-actions[bot]
authored andcommitted
fix for E2E tests
1 parent 86d9cd2 commit 64c9c6e

4 files changed

Lines changed: 9 additions & 33 deletions

File tree

apps/backend/db_patches/db_seeds/0002_InstrumentScientists.sql

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ $DO$
33
BEGIN
44

55
INSERT INTO users(
6-
user_id, user_title, firstname, lastname, username, preferredname, oidc_sub, oauth_refresh_token, gender, birthdate, department, "position", email,
7-
telephone, created_at, updated_at, institution_id, placeholder)
8-
VALUES (100, '', 'Instrument', 'Scientist1', 'instr.sci1', '-', 'instr.sci1.oauthsub', 'dummy-refresh-token', 'e2e user', '2020-10-10', 'IT', '', 'instr.sci1@local.host', '', NOW(), NOW(), 1, false);
6+
user_id, user_title, firstname, lastname, preferredname, oidc_sub, oauth_refresh_token, email, created_at, updated_at, institution_id
7+
)
8+
VALUES (100, '', 'Instrument', 'Scientist1', '-', 'instr.sci1.oauthsub', 'dummy-refresh-token', 'instr.sci1@local.host', NOW(), NOW(), 1);
99

1010
INSERT INTO users(
11-
user_id, user_title, firstname, lastname, username, preferredname, oidc_sub, oauth_refresh_token, gender, birthdate, department, "position", email,
12-
telephone, created_at, updated_at, institution_id, placeholder)
13-
VALUES (101, '', 'Instrument', 'Scientist2', 'instr.sci2', '-', 'instr.sci2.oauthsub', 'dummy-refresh-token', 'e2e user', '2020-10-10', 'IT', '', 'instr.sci2@local.host', '', NOW(), NOW(), 1, false);
11+
user_id, user_title, firstname, lastname, preferredname, oidc_sub, oauth_refresh_token, email, created_at, updated_at, institution_id
12+
)
13+
VALUES (101, '', 'Instrument', 'Scientist2', '-', 'instr.sci2.oauthsub', 'dummy-refresh-token', 'instr.sci2@local.host', NOW(), NOW(), 1);
1414

1515
-- user account with every roles except instrument scientist and user officer
1616
INSERT INTO users(
17-
user_id, user_title, firstname, lastname, username, preferredname, oidc_sub, oauth_refresh_token, gender, birthdate, department, "position", email,
18-
telephone, created_at, updated_at, institution_id, placeholder)
19-
VALUES (102, '', 'Not', 'Scientist', 'not.instr.sci', '-', 'not.instr.sci.oauthsub', 'dummy-refresh-token', 'e2e user', '2020-10-10', 'IT', '', 'not.instr.sci@local.host', '', NOW(), NOW(), 1, false);
17+
user_id, user_title, firstname, lastname, preferredname, oidc_sub, oauth_refresh_token, email, created_at, updated_at, institution_id
18+
)
19+
VALUES (102, '', 'Not', 'Scientist', '-', 'not.instr.sci.oauthsub', 'dummy-refresh-token', 'not.instr.sci@local.host', NOW(), NOW(), 1);
2020

2121
-- user account with experiment safety reviewer
2222
INSERT INTO users(

apps/backend/src/datasources/postgres/UserDataSource.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,12 @@ export default class PostgresUserDataSource implements UserDataSource {
149149
user_title: '',
150150
firstname,
151151
lastname,
152-
username: email,
153152
preferredname: firstname,
154153
oidc_sub: '',
155154
oauth_refresh_token: '',
156155
oauth_issuer: '',
157-
gender: '',
158-
birthdate: '2000-01-01',
159156
institution_id: 1,
160-
department: '',
161-
position: '',
162157
email,
163-
telephone: '',
164-
placeholder: true,
165158
})
166159
.returning(['*'])
167160
.into('users')
@@ -422,17 +415,11 @@ export default class PostgresUserDataSource implements UserDataSource {
422415
user_title: '',
423416
firstname: '',
424417
lastname: '',
425-
username: userId.toString(),
426418
preferredname: '',
427419
oidc_sub: '',
428420
oauth_refresh_token: '',
429-
gender: '',
430-
birthdate: '2000-01-01',
431421
institution_id: 1,
432-
department: '',
433-
position: '',
434422
email: userId.toString(),
435-
telephone: '',
436423
};
437424
}
438425

apps/e2e/cypress/e2e/FAPs.cy.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,13 +1251,8 @@ context('Fap reviews tests', () => {
12511251
cy.updateUserDetails({
12521252
...loggedInUserParsed,
12531253
institutionId: 1,
1254-
telephone: faker.phone.number('+4670#######'),
12551254
user_title: 'Dr.',
1256-
gender: 'male',
12571255
nationality: 1,
1258-
birthdate: new Date('2000/01/01'),
1259-
department: 'IT',
1260-
position: 'Dirrector',
12611256
} as UpdateUserMutationVariables);
12621257
}
12631258
cy.visit(`/FapPage/${createdFapId}?tab=3`);
@@ -1408,12 +1403,7 @@ context('Fap reviews tests', () => {
14081403
cy.updateUserDetails({
14091404
...loggedInUserParsed,
14101405
institutionId: 1,
1411-
telephone: faker.phone.number('+4670#######'),
14121406
user_title: 'Dr.',
1413-
gender: 'male',
1414-
birthdate: new Date('2000/01/01'),
1415-
department: 'IT',
1416-
position: 'Dirrector',
14171407
} as UpdateUserMutationVariables);
14181408
}
14191409

apps/frontend/src/components/user/UpdateUserInformation.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ export default function UpdateUserInformation(
137137
type="text"
138138
data-cy="preferredname"
139139
/>
140-
{/* Remove gender and birthdate fields */}
141140
</LocalizationProvider>
142141
</Grid>
143142
<Grid item xs={6}>

0 commit comments

Comments
 (0)