-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test
: [M3-6616] - Add tests to update/rename linode label (#10032)
* M3-6616 Add tests to update/rename linode label * Added changeset: Tests for updating/renaming Linode labels * Minor fix
- Loading branch information
1 parent
b254604
commit 9774383
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Tests | ||
--- | ||
|
||
Tests for updating/renaming Linode labels ([#10032](https://github.com/linode/manager/pull/10032)) |
45 changes: 45 additions & 0 deletions
45
packages/manager/cypress/e2e/core/linodes/update-linode-labels.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { createLinode } from 'support/api/linodes'; | ||
import { containsVisible, fbtVisible } from 'support/helpers'; | ||
import { ui } from 'support/ui'; | ||
import { cleanUp } from 'support/util/cleanup'; | ||
import { authenticate } from 'support/api/authentication'; | ||
import { randomLabel } from 'support/util/random'; | ||
|
||
authenticate(); | ||
describe('update linode label', () => { | ||
beforeEach(() => { | ||
cleanUp(['linodes']); | ||
}); | ||
|
||
it('updates a linode label from details page', () => { | ||
createLinode().then((linode) => { | ||
const newLinodeLabel = randomLabel(); | ||
cy.visitWithLogin(`/linodes/${linode.id}`); | ||
containsVisible('RUNNING'); | ||
|
||
cy.get(`[aria-label="Edit ${linode.label}"]`).click(); | ||
cy.get(`[id="edit-${linode.label}-label"]`) | ||
.click() | ||
.clear() | ||
.type(`${newLinodeLabel}{enter}`); | ||
|
||
cy.visitWithLogin('/linodes'); | ||
cy.get(`[data-qa-linode="${newLinodeLabel}"]`).should('be.visible'); | ||
}); | ||
}); | ||
|
||
it('updates a linode label from the "Settings" tab', () => { | ||
createLinode().then((linode) => { | ||
const newLinodeLabel = randomLabel(); | ||
cy.visitWithLogin(`/linodes/${linode.id}`); | ||
containsVisible('RUNNING'); | ||
|
||
cy.visitWithLogin(`/linodes/${linode.id}/settings`); | ||
cy.get('[id="label"]').click().clear().type(`${newLinodeLabel}{enter}`); | ||
ui.buttonGroup.findButtonByTitle('Save').should('be.visible').click(); | ||
|
||
cy.visitWithLogin('/linodes'); | ||
cy.get(`[data-qa-linode="${newLinodeLabel}"]`).should('be.visible'); | ||
}); | ||
}); | ||
}); |