Skip to content

Commit 83c03e2

Browse files
test [M3 8070]: apply linting part 6 (linode#11756)
* M3-8070 linting errors in longview -> parentChild dirs * M3-8070 fix broken test * Added changeset: Fix linting errors in additional directories in packages/manager/cypress/e2e
1 parent deb8915 commit 83c03e2

22 files changed

+233
-277
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Tests
3+
---
4+
5+
Fix linting errors in additional directories in packages/manager/cypress/e2e ([#11756](https://github.com/linode/manager/pull/11756))

packages/manager/.eslintrc.cjs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ module.exports = {
2323
'build',
2424
'storybook-static',
2525
'.storybook',
26-
'e2e/core/longview',
27-
'e2e/core/managed',
28-
'e2e/core/nodebalancers',
29-
'e2e/core/notificationsAndEvents',
30-
'e2e/core/objectStorage',
31-
'e2e/core/objectStorageGen2',
32-
'e2e/core/objectStorageMulticluster',
33-
'e2e/core/oneClickApps',
34-
'e2e/core/parentChild',
3526
'e2e/core/placementGroups',
3627
'e2e/core/stackscripts',
3728
'e2e/core/volumes',

packages/manager/cypress/e2e/core/longview/longview.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ describe('longview', () => {
321321
.click();
322322

323323
cy.get(`[data-qa-longview-client="${client.id}"]`).within(() => {
324-
cy.get(`[data-testid="textfield-input"]`).clear().type(newClient.label);
324+
cy.get(`[data-testid="textfield-input"]`).clear();
325+
cy.focused().type(newClient.label);
325326
cy.get(`[aria-label="Save new label"]`).should('be.visible').click();
326327
});
327328

packages/manager/cypress/e2e/core/managed/managed-contacts.spec.ts

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,16 @@ describe('Managed Contacts tab', () => {
8686
.within(() => {
8787
cy.findByLabelText('Name', { exact: false })
8888
.should('be.visible')
89-
.click()
90-
.type(contactName);
89+
.click();
90+
cy.focused().type(contactName);
9191

9292
cy.findByLabelText('E-mail', { exact: false })
9393
.should('be.visible')
94-
.click()
95-
.type(contactEmail);
94+
.click();
95+
cy.focused().type(contactEmail);
9696

97-
cy.findByLabelText('Primary Phone')
98-
.should('be.visible')
99-
.click()
100-
.type(contactPrimaryPhone);
97+
cy.findByLabelText('Primary Phone').should('be.visible').click();
98+
cy.focused().type(contactPrimaryPhone);
10199

102100
ui.buttonGroup
103101
.findButtonByTitle('Add Contact')
@@ -173,21 +171,19 @@ describe('Managed Contacts tab', () => {
173171
.within(() => {
174172
cy.findByLabelText('Name', { exact: false })
175173
.should('be.visible')
176-
.click()
177-
.clear()
178-
.type(contactNewName);
174+
.click();
175+
cy.focused().clear();
176+
cy.focused().type(contactNewName);
179177

180178
cy.findByLabelText('E-mail', { exact: false })
181179
.should('be.visible')
182-
.click()
183-
.clear()
184-
.type(contactNewEmail);
180+
.click();
181+
cy.focused().clear();
182+
cy.focused().type(contactNewEmail);
185183

186-
cy.findByLabelText('Primary Phone')
187-
.should('be.visible')
188-
.click()
189-
.clear()
190-
.type(contactNewPrimaryPhone);
184+
cy.findByLabelText('Primary Phone').should('be.visible').click();
185+
cy.focused().clear();
186+
cy.focused().type(contactNewPrimaryPhone);
191187

192188
ui.buttonGroup
193189
.findButtonByTitle('Save Changes')
@@ -241,10 +237,8 @@ describe('Managed Contacts tab', () => {
241237
.findByTitle(`Delete Contact ${contactName}?`)
242238
.should('be.visible')
243239
.within(() => {
244-
cy.findByLabelText('Contact Name:')
245-
.should('be.visible')
246-
.click()
247-
.type(contactName);
240+
cy.findByLabelText('Contact Name:').should('be.visible').click();
241+
cy.focused().type(contactName);
248242

249243
ui.buttonGroup
250244
.findButtonByTitle('Delete Contact')

packages/manager/cypress/e2e/core/managed/managed-credentials.spec.ts

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,16 @@ describe('Managed Credentials tab', () => {
7676
.findByTitle('Add Credential')
7777
.should('be.visible')
7878
.within(() => {
79-
cy.findByLabelText('Label')
80-
.should('be.visible')
81-
.click()
82-
.type(credentialLabel);
79+
cy.findByLabelText('Label').should('be.visible').click();
80+
cy.focused().type(credentialLabel);
8381

8482
cy.findByLabelText('Username', { exact: false })
8583
.should('be.visible')
86-
.click()
87-
.type(credentialUsername);
84+
.click();
85+
cy.focused().type(credentialUsername);
8886

89-
cy.findByLabelText('Password')
90-
.should('be.visible')
91-
.click()
92-
.type(credentialPassword);
87+
cy.findByLabelText('Password').should('be.visible').click();
88+
cy.focused().type(credentialPassword);
9389

9490
ui.buttonGroup
9591
.findButtonByTitle('Add Credential')
@@ -150,11 +146,9 @@ describe('Managed Credentials tab', () => {
150146
.should('be.visible')
151147
.within(() => {
152148
// Update label.
153-
cy.findByLabelText('Label')
154-
.should('be.visible')
155-
.click()
156-
.clear()
157-
.type(credentialNewLabel);
149+
cy.findByLabelText('Label').should('be.visible').click();
150+
cy.focused().clear();
151+
cy.focused().type(credentialNewLabel);
158152

159153
ui.button
160154
.findByTitle('Update label')
@@ -168,13 +162,11 @@ describe('Managed Credentials tab', () => {
168162
// Update credentials.
169163
cy.findByLabelText('Username', { exact: false })
170164
.should('be.visible')
171-
.click()
172-
.type(randomString());
165+
.click();
166+
cy.focused().type(randomString());
173167

174-
cy.findByLabelText('Password')
175-
.should('be.visible')
176-
.click()
177-
.type(randomString());
168+
cy.findByLabelText('Password').should('be.visible').click();
169+
cy.focused().type(randomString());
178170

179171
ui.button
180172
.findByTitle('Update credentials')
@@ -232,10 +224,8 @@ describe('Managed Credentials tab', () => {
232224
.findByTitle(`Delete Credential ${credentialLabel}?`)
233225
.should('be.visible')
234226
.within(() => {
235-
cy.findByLabelText('Credential Name:')
236-
.should('be.visible')
237-
.click()
238-
.type(credentialLabel);
227+
cy.findByLabelText('Credential Name:').should('be.visible').click();
228+
cy.focused().type(credentialLabel);
239229

240230
ui.buttonGroup
241231
.findButtonByTitle('Delete Credential')

packages/manager/cypress/e2e/core/managed/managed-monitors.spec.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,9 @@ describe('Managed Monitors tab', () => {
9494
.findByTitle('Edit Monitor')
9595
.should('be.visible')
9696
.within(() => {
97-
cy.findByLabelText('Monitor Label')
98-
.should('be.visible')
99-
.click()
100-
.clear()
101-
.type(newLabel);
97+
cy.findByLabelText('Monitor Label').should('be.visible').click();
98+
cy.focused().clear();
99+
cy.focused().type(newLabel);
102100

103101
mockUpdateServiceMonitor(1, newMonitor).as('updateMonitor');
104102
mockGetServiceMonitors([newMonitor]).as('getMonitors');
@@ -183,14 +181,12 @@ describe('Managed Monitors tab', () => {
183181
.within(() => {
184182
cy.findByLabelText('Monitor Label', { exact: false })
185183
.should('be.visible')
186-
.click()
187-
.type(monitorLabel);
184+
.click();
185+
cy.focused().type(monitorLabel);
188186

189187
// Can't `findByLabelText` because multiple elements with "URL" label exist.
190-
cy.get('input[name="address"]')
191-
.should('be.visible')
192-
.click()
193-
.type(monitorUrl);
188+
cy.get('input[name="address"]').should('be.visible').click();
189+
cy.focused().type(monitorUrl);
194190

195191
ui.buttonGroup
196192
.findButtonByTitle('Add Monitor')
@@ -249,10 +245,8 @@ describe('Managed Monitors tab', () => {
249245
.findByTitle(`Delete Monitor ${monitorLabel}?`)
250246
.should('be.visible')
251247
.within(() => {
252-
cy.findByLabelText('Monitor Name:')
253-
.should('be.visible')
254-
.click()
255-
.type(monitorLabel);
248+
cy.findByLabelText('Monitor Name:').should('be.visible').click();
249+
cy.focused().type(monitorLabel);
256250

257251
ui.buttonGroup
258252
.findButtonByTitle('Delete Monitor')

packages/manager/cypress/e2e/core/managed/managed-ssh.spec.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,17 @@ describe('Managed SSH Access tab', () => {
135135
.findByTitle(`Edit SSH Access for ${linodeLabel}`)
136136
.should('be.visible')
137137
.within(() => {
138-
cy.findByLabelText('User Account')
139-
.should('be.visible')
140-
.click()
141-
.clear()
142-
.type(newUser);
138+
cy.findByLabelText('User Account').should('be.visible').click();
139+
cy.focused().clear();
140+
cy.focused().type(newUser);
143141

144142
// Set IP address to 'Any'.
145-
cy.findByLabelText('IP Address')
146-
.should('be.visible')
147-
.click()
148-
.type('Any{enter}');
143+
cy.findByLabelText('IP Address').should('be.visible').click();
144+
cy.focused().type('Any{enter}');
149145

150-
cy.findByLabelText('Port')
151-
.should('be.visible')
152-
.click()
153-
.clear()
154-
.type(`${newPort}`);
146+
cy.findByLabelText('Port').should('be.visible').click();
147+
cy.focused().clear();
148+
cy.focused().type(`${newPort}`);
155149

156150
ui.button
157151
.findByTitle('Save Changes')

0 commit comments

Comments
 (0)