Skip to content

Commit e8d7aca

Browse files
committed
spaces (for now)
1 parent 4b1c032 commit e8d7aca

File tree

874 files changed

+75558
-76856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

874 files changed

+75558
-76856
lines changed

site/biome.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"files": {
33
"ignore": ["**/*Generated.ts"]
44
},
5+
"formatter": {
6+
"indentStyle": "space",
7+
"indentWidth": 2
8+
},
59
"linter": {
610
"rules": {
711
"a11y": {

site/e2e/api.ts

Lines changed: 126 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -9,174 +9,174 @@ import { findSessionToken, randomName } from "./helpers";
99
let currentOrgId: string;
1010

1111
export const setupApiCalls = async (page: Page) => {
12-
try {
13-
const token = await findSessionToken(page);
14-
API.setSessionToken(token);
15-
} catch {
16-
// If this fails, we have an unauthenticated client.
17-
}
18-
19-
API.setHost(`http://127.0.0.1:${coderPort}`);
12+
try {
13+
const token = await findSessionToken(page);
14+
API.setSessionToken(token);
15+
} catch {
16+
// If this fails, we have an unauthenticated client.
17+
}
18+
19+
API.setHost(`http://127.0.0.1:${coderPort}`);
2020
};
2121

2222
export const getCurrentOrgId = async (): Promise<string> => {
23-
if (currentOrgId) {
24-
return currentOrgId;
25-
}
26-
const currentUser = await API.getAuthenticatedUser();
27-
currentOrgId = currentUser.organization_ids[0];
28-
return currentOrgId;
23+
if (currentOrgId) {
24+
return currentOrgId;
25+
}
26+
const currentUser = await API.getAuthenticatedUser();
27+
currentOrgId = currentUser.organization_ids[0];
28+
return currentOrgId;
2929
};
3030

3131
export const createUser = async (orgId: string) => {
32-
const name = randomName();
33-
const user = await API.createUser({
34-
email: `${name}@coder.com`,
35-
username: name,
36-
name: name,
37-
password: "s3cure&password!",
38-
login_type: "password",
39-
disable_login: false,
40-
organization_id: orgId,
41-
});
42-
return user;
32+
const name = randomName();
33+
const user = await API.createUser({
34+
email: `${name}@coder.com`,
35+
username: name,
36+
name: name,
37+
password: "s3cure&password!",
38+
login_type: "password",
39+
disable_login: false,
40+
organization_id: orgId,
41+
});
42+
return user;
4343
};
4444

4545
export const createGroup = async (orgId: string) => {
46-
const name = randomName();
47-
const group = await API.createGroup(orgId, {
48-
name,
49-
display_name: `Display ${name}`,
50-
avatar_url: "/emojis/1f60d.png",
51-
quota_allowance: 0,
52-
});
53-
return group;
46+
const name = randomName();
47+
const group = await API.createGroup(orgId, {
48+
name,
49+
display_name: `Display ${name}`,
50+
avatar_url: "/emojis/1f60d.png",
51+
quota_allowance: 0,
52+
});
53+
return group;
5454
};
5555

5656
export const createOrganization = async () => {
57-
const name = randomName();
58-
const org = await API.createOrganization({
59-
name,
60-
display_name: `Org ${name}`,
61-
description: `Org description ${name}`,
62-
icon: "/emojis/1f957.png",
63-
});
64-
return org;
57+
const name = randomName();
58+
const org = await API.createOrganization({
59+
name,
60+
display_name: `Org ${name}`,
61+
description: `Org description ${name}`,
62+
icon: "/emojis/1f957.png",
63+
});
64+
return org;
6565
};
6666

6767
export async function verifyConfigFlagBoolean(
68-
page: Page,
69-
config: DeploymentConfig,
70-
flag: string,
68+
page: Page,
69+
config: DeploymentConfig,
70+
flag: string,
7171
) {
72-
const opt = findConfigOption(config, flag);
73-
const type = opt.value ? "option-enabled" : "option-disabled";
74-
const value = opt.value ? "Enabled" : "Disabled";
75-
76-
const configOption = page.locator(
77-
`div.options-table .option-${flag} .${type}`,
78-
);
79-
await expect(configOption).toHaveText(value);
72+
const opt = findConfigOption(config, flag);
73+
const type = opt.value ? "option-enabled" : "option-disabled";
74+
const value = opt.value ? "Enabled" : "Disabled";
75+
76+
const configOption = page.locator(
77+
`div.options-table .option-${flag} .${type}`,
78+
);
79+
await expect(configOption).toHaveText(value);
8080
}
8181

8282
export async function verifyConfigFlagNumber(
83-
page: Page,
84-
config: DeploymentConfig,
85-
flag: string,
83+
page: Page,
84+
config: DeploymentConfig,
85+
flag: string,
8686
) {
87-
const opt = findConfigOption(config, flag);
88-
const configOption = page.locator(
89-
`div.options-table .option-${flag} .option-value-number`,
90-
);
91-
await expect(configOption).toHaveText(String(opt.value));
87+
const opt = findConfigOption(config, flag);
88+
const configOption = page.locator(
89+
`div.options-table .option-${flag} .option-value-number`,
90+
);
91+
await expect(configOption).toHaveText(String(opt.value));
9292
}
9393

9494
export async function verifyConfigFlagString(
95-
page: Page,
96-
config: DeploymentConfig,
97-
flag: string,
95+
page: Page,
96+
config: DeploymentConfig,
97+
flag: string,
9898
) {
99-
const opt = findConfigOption(config, flag);
99+
const opt = findConfigOption(config, flag);
100100

101-
const configOption = page.locator(
102-
`div.options-table .option-${flag} .option-value-string`,
103-
);
104-
await expect(configOption).toHaveText(opt.value);
101+
const configOption = page.locator(
102+
`div.options-table .option-${flag} .option-value-string`,
103+
);
104+
await expect(configOption).toHaveText(opt.value);
105105
}
106106

107107
export async function verifyConfigFlagEmpty(page: Page, flag: string) {
108-
const configOption = page.locator(
109-
`div.options-table .option-${flag} .option-value-empty`,
110-
);
111-
await expect(configOption).toHaveText("Not set");
108+
const configOption = page.locator(
109+
`div.options-table .option-${flag} .option-value-empty`,
110+
);
111+
await expect(configOption).toHaveText("Not set");
112112
}
113113

114114
export async function verifyConfigFlagArray(
115-
page: Page,
116-
config: DeploymentConfig,
117-
flag: string,
115+
page: Page,
116+
config: DeploymentConfig,
117+
flag: string,
118118
) {
119-
const opt = findConfigOption(config, flag);
120-
const configOption = page.locator(
121-
`div.options-table .option-${flag} .option-array`,
122-
);
123-
124-
// Verify array of options with simple dots
125-
for (const item of opt.value) {
126-
await expect(configOption.locator("li", { hasText: item })).toBeVisible();
127-
}
119+
const opt = findConfigOption(config, flag);
120+
const configOption = page.locator(
121+
`div.options-table .option-${flag} .option-array`,
122+
);
123+
124+
// Verify array of options with simple dots
125+
for (const item of opt.value) {
126+
await expect(configOption.locator("li", { hasText: item })).toBeVisible();
127+
}
128128
}
129129

130130
export async function verifyConfigFlagEntries(
131-
page: Page,
132-
config: DeploymentConfig,
133-
flag: string,
131+
page: Page,
132+
config: DeploymentConfig,
133+
flag: string,
134134
) {
135-
const opt = findConfigOption(config, flag);
136-
const configOption = page.locator(
137-
`div.options-table .option-${flag} .option-array`,
138-
);
139-
140-
// Verify array of options with green marks.
141-
Object.entries(opt.value)
142-
.sort((a, b) => a[0].localeCompare(b[0]))
143-
.map(async ([item]) => {
144-
await expect(
145-
configOption.locator(`.option-array-item-${item}.option-enabled`, {
146-
hasText: item,
147-
}),
148-
).toBeVisible();
149-
});
135+
const opt = findConfigOption(config, flag);
136+
const configOption = page.locator(
137+
`div.options-table .option-${flag} .option-array`,
138+
);
139+
140+
// Verify array of options with green marks.
141+
Object.entries(opt.value)
142+
.sort((a, b) => a[0].localeCompare(b[0]))
143+
.map(async ([item]) => {
144+
await expect(
145+
configOption.locator(`.option-array-item-${item}.option-enabled`, {
146+
hasText: item,
147+
}),
148+
).toBeVisible();
149+
});
150150
}
151151

152152
export async function verifyConfigFlagDuration(
153-
page: Page,
154-
config: DeploymentConfig,
155-
flag: string,
153+
page: Page,
154+
config: DeploymentConfig,
155+
flag: string,
156156
) {
157-
const opt = findConfigOption(config, flag);
158-
const configOption = page.locator(
159-
`div.options-table .option-${flag} .option-value-string`,
160-
);
161-
await expect(configOption).toHaveText(
162-
formatDuration(
163-
// intervalToDuration takes ms, so convert nanoseconds to ms
164-
intervalToDuration({
165-
start: 0,
166-
end: (opt.value as number) / 1e6,
167-
}),
168-
),
169-
);
157+
const opt = findConfigOption(config, flag);
158+
const configOption = page.locator(
159+
`div.options-table .option-${flag} .option-value-string`,
160+
);
161+
await expect(configOption).toHaveText(
162+
formatDuration(
163+
// intervalToDuration takes ms, so convert nanoseconds to ms
164+
intervalToDuration({
165+
start: 0,
166+
end: (opt.value as number) / 1e6,
167+
}),
168+
),
169+
);
170170
}
171171

172172
export function findConfigOption(
173-
config: DeploymentConfig,
174-
flag: string,
173+
config: DeploymentConfig,
174+
flag: string,
175175
): SerpentOption {
176-
const opt = config.options.find((option) => option.flag === flag);
177-
if (opt === undefined) {
178-
// must be undefined as `false` is expected
179-
throw new Error(`Option with env ${flag} has undefined value.`);
180-
}
181-
return opt;
176+
const opt = config.options.find((option) => option.flag === flag);
177+
if (opt === undefined) {
178+
// must be undefined as `false` is expected
179+
throw new Error(`Option with env ${flag} has undefined value.`);
180+
}
181+
return opt;
182182
}

site/e2e/constants.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export const coderMain = path.join(__dirname, "../../enterprise/cmd/coder");
44

55
// Default port from the server
66
export const coderPort = process.env.CODER_E2E_PORT
7-
? Number(process.env.CODER_E2E_PORT)
8-
: 3111;
7+
? Number(process.env.CODER_E2E_PORT)
8+
: 3111;
99
export const prometheusPort = 2114;
1010
export const workspaceProxyPort = 3112;
1111

@@ -19,23 +19,23 @@ export const password = "SomeSecurePassword!";
1919
export const email = "admin@coder.com";
2020

2121
export const gitAuth = {
22-
deviceProvider: "device",
23-
webProvider: "web",
24-
// These ports need to be hardcoded so that they can be
25-
// used in `playwright.config.ts` to set the environment
26-
// variables for the server.
27-
devicePort: 50515,
28-
webPort: 50516,
29-
30-
authPath: "/auth",
31-
tokenPath: "/token",
32-
codePath: "/code",
33-
validatePath: "/validate",
34-
installationsPath: "/installations",
22+
deviceProvider: "device",
23+
webProvider: "web",
24+
// These ports need to be hardcoded so that they can be
25+
// used in `playwright.config.ts` to set the environment
26+
// variables for the server.
27+
devicePort: 50515,
28+
webPort: 50516,
29+
30+
authPath: "/auth",
31+
tokenPath: "/token",
32+
codePath: "/code",
33+
validatePath: "/validate",
34+
installationsPath: "/installations",
3535
};
3636

3737
export const requireEnterpriseTests = Boolean(
38-
process.env.CODER_E2E_REQUIRE_ENTERPRISE_TESTS,
38+
process.env.CODER_E2E_REQUIRE_ENTERPRISE_TESTS,
3939
);
4040
export const enterpriseLicense = process.env.CODER_E2E_ENTERPRISE_LICENSE ?? "";
4141

0 commit comments

Comments
 (0)