Skip to content

Commit

Permalink
feat(hycu): disabled change pack
Browse files Browse the repository at this point in the history
ref: MANAGER-16039

Signed-off-by: Thibault Barske <[email protected]>

Signed-off-by: Thibault Barske <[email protected]>
  • Loading branch information
tibs245 committed Nov 14, 2024
1 parent 17431f3 commit 5c9f48c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 45 deletions.
2 changes: 2 additions & 0 deletions packages/manager/apps/hycu/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ export const packTypeLabel = {
'hycu-cloud-vm-pack-500': '500 VMs',
} as const;

export const HYCU_CHANGE_PACK_FEATURE_ACTIVATED = false;

export const LICENSE_FILE_EXT = '.req';
export const LICENSE_FILE_NAME_TEMPLATE = `license-hycu-{serviceName}.dat`;
Original file line number Diff line number Diff line change
Expand Up @@ -56,48 +56,16 @@ describe('License Hycu shortcuts tile for dashboard test suite', () => {
).toBeVisible(),
{ timeout: 20_000 },
);
await waitFor(
() =>
expect(
screen.getByText(
labels.dashboard.hycu_dashboard_link_change_pack_type,
),
).toBeVisible(),
{ timeout: 20_000 },
);
});

it('should show links of services activated', async () => {
await renderTestApp(`/${licensesHycu[0].serviceName}`, {
licenseStatus: LicenseStatus.ACTIVATED,
});

await waitFor(
() =>
expect(
screen.getAllByText(
labels.dashboard.hycu_dashboard_shortcuts_title,
)[0],
).toBeVisible(),
{ timeout: 30_000 },
);

await waitFor(
() =>
expect(
screen.getByText(labels.dashboard.hycu_dashboard_link_regenerate),
).toBeVisible(),
{ timeout: 20_000 },
);
await waitFor(
() =>
expect(
screen.getByText(
labels.dashboard.hycu_dashboard_link_change_pack_type,
),
).toBeVisible(),
{ timeout: 20_000 },
);
// See: MANAGER-16039. Will be decommented on near future
// await waitFor(
// () =>
// expect(
// screen.getByText(
// labels.dashboard.hycu_dashboard_link_change_pack_type,
// ),
// ).toBeVisible(),
// { timeout: 20_000 },
// );
});

it('Can open activate modal with IAM authorization', async () => {
Expand Down Expand Up @@ -214,7 +182,8 @@ describe('License Hycu shortcuts tile for dashboard test suite', () => {
);
});

it('Can open edit page with IAM authorization', async () => {
// Skip Because: MANAGER-16039. Will be uncommented on near future
it.skip('Can open edit page with IAM authorization', async () => {
const user = userEvent.setup();
await renderTestApp(`/${licensesHycu[0].serviceName}`, {
licenseStatus: LicenseStatus.ACTIVATED,
Expand All @@ -239,7 +208,8 @@ describe('License Hycu shortcuts tile for dashboard test suite', () => {
);
});

it("Can't open edit page without IAM authorization", async () => {
// Skip because: MANAGER-16039. Will be decommented on near future
it.skip("Can't open edit page without IAM authorization", async () => {
const user = userEvent.setup();
await renderTestApp(`/${licensesHycu[1].serviceName}`, {
licenseStatus: LicenseStatus.ACTIVATED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
ManagerLinkProps,
} from '@/components/ManagerLink/ManagerLink.component';
import { IAM_ACTIONS } from '@/utils/iam.constants';
import { HYCU_CHANGE_PACK_FEATURE_ACTIVATED } from '@/constants';

const ShortcutsItem = ({ children, ...rest }: ManagerLinkProps) => (
<ManagerLink color={ODS_THEME_COLOR_INTENT.primary} {...rest}>
Expand Down Expand Up @@ -116,7 +117,9 @@ const ShortcutsTile = ({ serviceName }: { serviceName: string }) => {
!hycuDetail?.data.controllerId
? links.linkActivated
: links.linkReactivated,
hycuDetail?.data.licenseStatus === LicenseStatus.ACTIVATED &&
((HYCU_CHANGE_PACK_FEATURE_ACTIVATED &&
hycuDetail?.data.licenseStatus === LicenseStatus.ACTIVATED) ||
undefined) &&
links.linkChangePackType,
].filter(Boolean)}
></DashboardTile>
Expand Down

0 comments on commit 5c9f48c

Please sign in to comment.