Skip to content

Commit

Permalink
test: [M3-6616] - Add tests to update/rename linode label (#10032)
Browse files Browse the repository at this point in the history
* M3-6616 Add tests to update/rename linode label

* Added changeset: Tests for updating/renaming Linode labels

* Minor fix
  • Loading branch information
cliu-akamai authored Jan 12, 2024
1 parent b254604 commit 9774383
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10032-tests-1704400629879.md
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))
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');
});
});
});

0 comments on commit 9774383

Please sign in to comment.