Skip to content

Commit 996e47a

Browse files
committed
add test for toUser
1 parent 471386e commit 996e47a

File tree

4 files changed

+165
-1
lines changed

4 files changed

+165
-1
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"result": {
3+
"id": "007a807f-f2a7-436b-a77f-66ed11ee7828",
4+
"organizationId": "6f5b2707-c83f-4e04-a37c-23d1b1d385ae",
5+
"name": "Gitpod Tester",
6+
"avatarUrl": "https://avatars.githubusercontent.com/u/37021919?v=4",
7+
"createdAt": "2023-12-04T08:54:31.686Z",
8+
"identities": [
9+
{
10+
"authProviderId": "Public-GitHub",
11+
"authId": "37021919",
12+
"authName": "GitpodTester",
13+
"primaryEmail": "[email protected]"
14+
}
15+
],
16+
"blocked": false,
17+
"lastVerificationTime": "2023-12-04T08:54:31.700Z",
18+
"verificationPhoneNumber": "+49150-111111111",
19+
"workspaceTimeoutSettings": {
20+
"inactivity": "3600s",
21+
"disabledDisconnected": true
22+
},
23+
"emailNotificationSettings": {
24+
"allowsChangelogMail": true,
25+
"allowsDevxMail": true,
26+
"allowsOnboardingMail": true
27+
},
28+
"editorSettings": {
29+
"name": "code",
30+
"version": "latest"
31+
},
32+
"dotfileRepo": "https://github.com/gitpod-samples/demo-dotfiles-with-gitpod",
33+
"workspaceClass": "XXXL",
34+
"profile": {
35+
"lastUpdatedDetailsNudge": "2023-12-04T08:54:34.831Z",
36+
"acceptedPrivacyPolicyDate": "2023-12-04T08:54:31.700Z",
37+
"companyName": "",
38+
"emailAddress": "[email protected]",
39+
"jobRole": "other",
40+
"jobRoleOther": "",
41+
"explorationReasons": [
42+
"replace-remote-dev",
43+
"replace-remote-dev"
44+
],
45+
"signupGoals": [
46+
"other",
47+
"other"
48+
],
49+
"signupGoalsOther": "",
50+
"onboardedTimestamp": "2023-12-04T08:54:41.326Z",
51+
"companySize": ""
52+
},
53+
"workspaceAutostartOptions": [
54+
{
55+
"cloneUrl": "https://github.com/gitpod-io/gitpod",
56+
"organizationId": "6f5b2707-c83f-4e04-a37c-23d1b1d385ae",
57+
"workspaceClass": "XXXL",
58+
"editorSettings": {
59+
"name": "code",
60+
"version": "stable"
61+
},
62+
"region": ""
63+
}
64+
],
65+
"usageAttributionId": "",
66+
"workspaceFeatureFlags": [
67+
"USER_FEATURE_FLAG_FULL_WORKSPACE_BACKUP"
68+
],
69+
"rolesOrPermissions": [
70+
"ROLE_OR_PERMISSION_ADMIN",
71+
"ROLE_OR_PERMISSION_DEVELOPER"
72+
]
73+
},
74+
"err": ""
75+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"id": "007a807f-f2a7-436b-a77f-66ed11ee7828",
3+
"creationDate": "2023-12-04T08:54:31.686Z",
4+
"avatarUrl": "https://avatars.githubusercontent.com/u/37021919?v=4",
5+
"name": "GitpodTester",
6+
"fullName": "Gitpod Tester",
7+
"organizationId": "6f5b2707-c83f-4e04-a37c-23d1b1d385ae",
8+
"verificationPhoneNumber": "+49150-111111111",
9+
"blocked": false,
10+
"featureFlags": {
11+
"permanentWSFeatureFlags": [
12+
"full_workspace_backup"
13+
]
14+
},
15+
"rolesOrPermissions": [
16+
"admin",
17+
"developer"
18+
],
19+
"markedDeleted": false,
20+
"noReleasePeriod": false,
21+
"additionalData": {
22+
"emailNotificationSettings": {
23+
"allowsChangelogMail": true,
24+
"allowsDevXMail": true,
25+
"allowsOnboardingMail": true
26+
},
27+
"profile": {
28+
"acceptedPrivacyPolicyDate": "2023-12-04T08:54:31.700Z",
29+
"emailAddress": "[email protected]",
30+
"lastUpdatedDetailsNudge": "2023-12-04T08:54:34.831Z",
31+
"jobRole": "other",
32+
"jobRoleOther": "",
33+
"explorationReasons": [
34+
"replace-remote-dev",
35+
"replace-remote-dev"
36+
],
37+
"signupGoals": [
38+
"other",
39+
"other"
40+
],
41+
"signupGoalsOther": "",
42+
"companySize": "",
43+
"onboardedTimestamp": "2023-12-04T08:54:41.326Z",
44+
"name": "Gitpod Tester",
45+
"email": "[email protected]",
46+
"company": "",
47+
"avatarURL": "https://avatars.githubusercontent.com/u/37021919?v=4"
48+
},
49+
"shouldSeeMigrationMessage": false,
50+
"ideSettings": {
51+
"settingVersion": "2.0",
52+
"defaultIde": "code",
53+
"useLatestVersion": true
54+
},
55+
"workspaceAutostartOptions": [
56+
{
57+
"cloneURL": "https://github.com/gitpod-io/gitpod",
58+
"organizationId": "6f5b2707-c83f-4e04-a37c-23d1b1d385ae",
59+
"ideSettings": {
60+
"defaultIde": "code"
61+
},
62+
"workspaceClass": "XXXL"
63+
}
64+
],
65+
"disabledClosedTimeout": true,
66+
"workspaceTimeout": "1h",
67+
"dotfileRepo": "https://github.com/gitpod-samples/demo-dotfiles-with-gitpod",
68+
"workspaceClasses": {
69+
"regular": "XXXL"
70+
}
71+
},
72+
"lastVerificationTime": "2023-12-04T08:54:31.700Z",
73+
"fgaRelationshipsVersion": 5,
74+
"identities": [
75+
{
76+
"authProviderId": "Public-GitHub",
77+
"authId": "37021919",
78+
"authName": "GitpodTester",
79+
"primaryEmail": "[email protected]",
80+
"deleted": false,
81+
"readonly": false
82+
}
83+
]
84+
}

components/public-api/typescript-common/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"test": "mocha './**/*.spec.js' --exclude './node_modules/**' --exclude './lib/esm/**' --exit",
2020
"test:forceUpdate": "mocha './**/*.spec.js' --exclude './node_modules/**' --exclude './lib/esm/**' --exit -force -update && yarn format:fixtures",
2121
"test:leeway": "yarn build && yarn test",
22-
"format:fixtures": "git ls-files -- 'fixtures/*' | xargs pre-commit run end-of-file-fixer --files > /dev/null || exit 0"
22+
"format:fixtures": "git ls-files -- 'fixtures/*' | xargs pre-commit run end-of-file-fixer --files > /dev/null || exit 0",
23+
"watch": "leeway exec --package .:lib --transitive-dependencies --filter-type yarn --components --parallel -- tsc -w --preserveWatchOutput"
2324
},
2425
"dependencies": {
2526
"@bufbuild/protobuf": "^1.3.3",

components/public-api/typescript-common/src/public-api-converter.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ describe("PublicAPIConverter", () => {
3333
const converter = new PublicAPIConverter();
3434

3535
describe("golden tests", () => {
36+
it.only("toUser", async () => {
37+
await startFixtureTest("../fixtures/toUser_*.json", async (input) => converter.toUser(input));
38+
});
39+
3640
it("toOrganization", async () => {
3741
await startFixtureTest("../fixtures/toOrganization_*.json", async (input) =>
3842
converter.toOrganization(input),

0 commit comments

Comments
 (0)