Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-13083-tests-1762969859293.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Fix flakey vm-host test ([#13083](https://github.com/linode/manager/pull/13083))
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { mockGetNotifications } from 'support/intercepts/events';
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { mockGetLinode, mockGetLinodes } from 'support/intercepts/linodes';
import { mockGetProfile } from 'support/intercepts/profile';
import { ui } from 'support/ui';
import { randomLabel } from 'support/util/random';
import { chooseRegion } from 'support/util/regions';

Expand Down Expand Up @@ -34,6 +35,8 @@ const mockMaintenanceScheduled = accountMaintenanceFactory.build({
type: 'reboot',
description: 'scheduled',
maintenance_policy_set: 'linode/power_off_on',
reason:
"Your Linode's host has reached the end of its life cycle and will be retired.",
status: 'scheduled',
start_time: '2022-01-17T23:45:46.960',
});
Expand All @@ -48,6 +51,7 @@ const mockMaintenanceEmergency = accountMaintenanceFactory.build({
type: 'cold_migration',
description: 'emergency',
maintenance_policy_set: 'linode/power_off_on',
reason: "We must upgrade the OS of your Linode's host.",
status: 'scheduled',
});

Expand Down Expand Up @@ -107,6 +111,38 @@ describe('Host & VM maintenance notification banner', () => {
});
});

it('maintenance notification banner does not display platform maintenance messages', function () {
const mockPlatformMaintenance = accountMaintenanceFactory.build({
entity: {
id: mockLinodes[1].id,
label: mockLinodes[1].label,
type: 'linode',
url: `/v4/linode/instances/${mockLinodes[1].id}`,
},
type: 'reboot',
description: 'emergency',
maintenance_policy_set: 'linode/power_off_on',
// 'critical security update' in reason prevents message from displaying
reason: "We must apply a critical security update to your Linode's host.",
status: 'scheduled',
});
mockGetMaintenance([mockPlatformMaintenance], []).as('getMaintenances');
cy.visitWithLogin('/linodes');
cy.wait([
'@getLinodes',
'@getFeatureFlags',
'@getNotifications',
'@getMaintenances',
]);
cy.get('#main-content').within(() => {
ui.button
.findByTitle('Create Linode')
.should('be.visible')
.should('be.enabled');
cy.get('[data-testid="maintenance-banner').should('not.exist');
});
});

it('banner present on details page when linode has pending maintenance', function () {
const mockLinode = mockLinodes[0];
mockGetLinode(mockLinode.id, mockLinode).as('getLinode');
Expand Down