Skip to content

Commit f1109d1

Browse files
committed
frontend/tests: remove unnecessary comments.
1 parent a6d903f commit f1109d1

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

frontend/tests/basic.spec.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { login, mailiskClient, mailiskNameSpace, needCustomCert, testDomain, tes
44
test('has title', async ({ page }) => {
55
await page.goto(testDomain);
66

7-
// Expect a title "to contain" a substring.
87
await expect(page).toHaveTitle(/Remote Access/);
98
});
109

@@ -31,13 +30,11 @@ test('invalid register form', async ({ page }) => {
3130
test('invalid login attempts', async ({ page }) => {
3231
await page.goto(testDomain);
3332

34-
// Test with wrong password
3533
await page.getByRole('textbox', { name: 'Email' }).fill(testUser1Email);
3634
await page.getByRole('textbox', { name: 'Password' }).fill('wrong_password');
3735
await page.getByRole('button', { name: 'Login' }).click();
3836
await expect(page.getByText('Email-address or password wrong.')).toBeVisible();
3937

40-
// Test with non-existent email
4138
await page.getByRole('textbox', { name: 'Email' }).fill('[email protected]');
4239
await page.getByRole('textbox', { name: 'Password' }).fill(testPassword1);
4340
await page.getByRole('button', { name: 'Login' }).click();
@@ -47,14 +44,12 @@ test('invalid login attempts', async ({ page }) => {
4744
test('navigation and logout', async ({ page }) => {
4845
await login(page, testUser1Email, testPassword1);
4946

50-
// Test navigation to different pages
5147
await page.getByRole('link', { name: 'Token' }).click();
5248
await expect(page.getByRole('heading', { name: 'Create authorization token' })).toBeVisible();
5349

5450
await page.getByRole('link', { name: 'Account' }).click();
5551
await expect(page.getByRole('heading', { name: 'Account information' })).toBeVisible();
5652

57-
// Test logout
5853
await page.getByRole('button', { name: 'Logout', exact: true }).click();
5954
await expect(page.getByRole('button', { name: 'Login' })).toBeVisible();
6055
});
@@ -64,23 +59,18 @@ test('token management', async ({ page }) => {
6459

6560
await page.getByRole('link', { name: 'Token' }).click();
6661

67-
// Create a token
6862
await page.getByRole('textbox', { name: 'Name' }).fill('Test Token 1');
6963
await page.getByRole('button', { name: 'Create token' }).click();
7064

71-
// Verify token appears in list
7265
await expect(page.getByText('Test Token 1')).toBeVisible();
7366

74-
// Create another token
7567
await page.getByRole('textbox', { name: 'Name' }).clear();
7668
await page.getByRole('textbox', { name: 'Name' }).fill('Test Token 2');
7769
await page.getByRole('button', { name: 'Create token' }).click();
7870

79-
// Verify both tokens exist
8071
await expect(page.getByText('Test Token 1')).toBeVisible();
8172
await expect(page.getByText('Test Token 2')).toBeVisible();
8273

83-
// Delete a token
8474
await page.getByRole('button', { name: 'Delete' }).nth(0).click();
8575
await expect(page.getByText('Test Token 1')).not.toBeVisible();
8676
await expect(page.getByText('Test Token 2')).toBeVisible();
@@ -91,8 +81,7 @@ test('account information validation', async ({ page }) => {
9181

9282
await page.getByRole('link', { name: 'Account' }).click();
9383

94-
// Test invalid name (empty)
95-
await page.getByLabel('Name').clear();
84+
await page.getByLabel('Name').fill("");
9685
await page.getByRole('button', { name: 'Save changes' }).click();
9786
await expect(page.getByText('The name must not be empty')).toBeVisible();
9887

@@ -123,7 +112,6 @@ test('password change dialog validation', async ({ page }) => {
123112
test('charger lifecycle', async ({ page }) => {
124113
test.slow();
125114

126-
// Add charger
127115
await page.goto(testWallboxDomain + '/#status');
128116
await page.getByRole('button', { name: 'System' }).click();
129117
await page.getByRole('button', { name: 'Remote Access' }).click();
@@ -141,15 +129,13 @@ test('charger lifecycle', async ({ page }) => {
141129
await page.getByLabel('Passwordonly used for the reg').press('Enter');
142130
await page.getByRole('button', { name: 'Reboot' }).click();
143131

144-
// Connect to charger
145132
await login(page, testUser1Email, testPassword1);
146133
await expect(page.locator('tbody')).toContainText(testWallboxUID);
147134
await expect(page.locator('.bg-success').first()).toBeVisible({timeout: 100_000});
148135
await page.getByRole('button', { name: 'Connect' }).click();
149136
await expect(page.locator('#interface').contentFrame().getByRole('heading', { name: 'Status' })).toBeVisible({timeout: 15_000});
150137
await page.locator('#interface').contentFrame().getByRole('button', { name: 'Close remote access' }).click();
151138

152-
// Remove charger
153139
await page.goto(testWallboxDomain + '/#status');
154140
await page.getByRole('button', { name: 'System' }).click();
155141
await page.getByRole('button', { name: 'Remote Access' }).click();
@@ -167,13 +153,11 @@ test('add charger with auth token', async ({page}) => {
167153

168154
await login(page, testUser1Email, testPassword1);
169155

170-
// Create token
171156
await page.getByRole('link', { name: 'Token' }).click();
172157
await page.getByRole('textbox', { name: 'Name' }).fill('Test');
173158
await page.getByRole('button', { name: 'Create token' }).click();
174159
const token = await page.getByRole('textbox').nth(1).inputValue();
175160

176-
// Add charger
177161
await page.goto(testWallboxDomain);
178162
await page.getByRole('button', { name: 'System' }).click();
179163
await page.getByRole('button', { name: 'Event Log' }).click();
@@ -185,7 +169,6 @@ test('add charger with auth token', async ({page}) => {
185169
await page.getByRole('button', { name: 'Add' }).click();
186170
await page.getByRole('button', { name: 'Reboot' }).click();
187171

188-
// Connect to charger
189172
await page.goto(testDomain);
190173
await expect(page.locator('tbody')).toContainText(testWallboxUID);
191174
await expect(page.locator('.bg-success').first()).toBeVisible({timeout: 100_000});
@@ -233,8 +216,6 @@ test('change accountname', async ({page}) => {
233216
await expect(page.getByRole('heading', { name: 'Account information' })).toBeVisible();
234217
});
235218

236-
// ===== TESTS AFTER THIS POINT CREATE NEW USERS OR USE DIFFERENT CREDENTIALS =====
237-
238219
test('change password', async ({page}) => {
239220
await login(page, testUser2Email, testPassword1);
240221

0 commit comments

Comments
 (0)