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-13572-tests-1775773189306.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Mock private image sharing flag to be disabled in Image tests ([#13572](https://github.com/linode/manager/pull/13572))
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ describe('restricted user details pages', () => {
mockAppendFeatureFlags({
apl: false,
dbaasV2: { beta: false, enabled: false },
privateImageSharing: false,
});
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { authenticate } from 'support/api/authentication';
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { ui } from 'support/ui';
import { cleanUp } from 'support/util/cleanup';
import { createTestLinode } from 'support/util/linodes';
Expand All @@ -12,6 +13,10 @@ describe('create image (e2e)', () => {
cleanUp(['linodes', 'images']);
});

beforeEach(() => {
mockAppendFeatureFlags({ privateImageSharing: false });
});

it('create image from a linode', () => {
cy.tag('method:e2e');
const label = randomLabel();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { linodeFactory } from '@linode/utilities';
import { firewallFactory, imageFactory } from '@src/factories';
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { mockGetFirewalls } from 'support/intercepts/firewalls';
import { mockGetAllImages } from 'support/intercepts/images';
import { ui } from 'support/ui';
Expand Down Expand Up @@ -81,6 +82,10 @@ const createLinodeWithImageMock = (url: string, preselectedImage: boolean) => {
};

describe('create linode from image, mocked data', () => {
beforeEach(() => {
mockAppendFeatureFlags({ privateImageSharing: false });
});

/*
* - Confirms UI flow when user attempts to create a Linode from images without having any images.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { grantsFactory, profileFactory } from '@linode/utilities';
import { accountUserFactory } from '@src/factories/accountUsers';
import { mockGetUser } from 'support/intercepts/account';
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { mockGetAllImages } from 'support/intercepts/images';
import {
mockGetProfile,
Expand All @@ -13,6 +14,7 @@ describe('Images empty landing page', () => {
beforeEach(() => {
// Mock setup to display the Image landing page in an empty state
mockGetAllImages([]).as('getImages');
mockAppendFeatureFlags({ privateImageSharing: false });
});

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { profileFactory } from '@linode/utilities';
import { grantsFactory } from '@linode/utilities';
import { mockGetUser } from 'support/intercepts/account';
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import {
mockGetCustomImages,
mockGetRecoveryImages,
Expand Down Expand Up @@ -74,6 +75,9 @@ describe('image landing checks for non-empty state with restricted user', () =>
});
});

// Disable Private Image Sharing feature flag.
mockAppendFeatureFlags({ privateImageSharing: false });

// Mock setup to display the Image landing page in an non-empty state
mockGetCustomImages(mockCustomImages).as('getCustomImages');
mockGetRecoveryImages(mockRecoveryImages).as('getRecoveryImages');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
} from '@linode/utilities';
import { mockGetUser } from 'support/intercepts/account';
import { mockGetEvents } from 'support/intercepts/events';
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { mockCreateImage } from 'support/intercepts/images';
import { mockGetLinodeDisks, mockGetLinodes } from 'support/intercepts/linodes';
import {
Expand All @@ -19,6 +20,10 @@ import { linodeDiskFactory } from 'src/factories/disk';
import { imageFactory } from 'src/factories/images';

describe('create image (using mocks)', () => {
beforeEach(() => {
mockAppendFeatureFlags({ privateImageSharing: false });
});

it('create image from a linode', () => {
const mockDisks = [
linodeDiskFactory.build({ filesystem: 'ext4', label: 'Debian 12 Disk' }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ describe('rebuild linode', () => {
iam: {
enabled: false,
},
privateImageSharing: false,
});
});

Expand Down Expand Up @@ -525,6 +526,7 @@ describe('rebuild linode', () => {
enabled: true,
la: true,
},
privateImageSharing: false,
}).as('getFeatureFlags');
mockGetRegionAvailability(linodeCreatePayload.region, []).as(
'getRegionAvailability'
Expand Down
Loading