test: Remove out-of-date comments
This cleans up comments in tests and removes all that are no longer relevant.
This commit is contained in:
parent
28d37ded06
commit
62673813e2
5 changed files with 1 additions and 187 deletions
|
|
@ -242,7 +242,6 @@ describe('Step Upload to Azure', () => {
|
|||
await screen.findByText(
|
||||
/Sources cannot be reached, try again later or enter an account info for upload manually\./i
|
||||
);
|
||||
//
|
||||
});
|
||||
|
||||
// set test timeout to 15 seconds
|
||||
|
|
|
|||
|
|
@ -273,7 +273,6 @@ describe('Step Packages', () => {
|
|||
// review page
|
||||
clickNext();
|
||||
|
||||
// await screen.findByTestId('chosen-packages-count');
|
||||
let chosen = await screen.findByTestId('chosen-packages-count');
|
||||
expect(chosen).toHaveTextContent('2');
|
||||
|
||||
|
|
@ -292,7 +291,6 @@ describe('Step Packages', () => {
|
|||
clickNext();
|
||||
clickNext();
|
||||
|
||||
// await screen.findByTestId('chosen-packages-count');
|
||||
chosen = await screen.findByTestId('chosen-packages-count');
|
||||
expect(chosen).toHaveTextContent('1');
|
||||
});
|
||||
|
|
@ -486,7 +484,6 @@ describe('Step Packages', () => {
|
|||
chosenPackagesItems = await within(chosenPackagesList).findAllByRole(
|
||||
'option'
|
||||
);
|
||||
// eslint-disable-next-line jest-dom/prefer-in-document
|
||||
expect(chosenPackagesItems).toHaveLength(1);
|
||||
|
||||
await user.click(
|
||||
|
|
@ -543,8 +540,6 @@ describe('Step Packages', () => {
|
|||
name: /search input/i,
|
||||
});
|
||||
|
||||
//const searchbox = screen.getAllByRole('textbox')[0]; // searching by id doesn't update the input ref
|
||||
|
||||
await waitFor(() => expect(searchbox).toBeEnabled());
|
||||
await user.click(searchbox);
|
||||
|
||||
|
|
@ -637,7 +632,6 @@ describe('Step Packages', () => {
|
|||
// review page
|
||||
clickNext();
|
||||
|
||||
// await screen.findByTestId('chosen-packages-count');
|
||||
const chosen = await screen.findByTestId('chosen-packages-count');
|
||||
expect(chosen).toHaveTextContent('2');
|
||||
});
|
||||
|
|
@ -757,7 +751,6 @@ describe('Step Packages', () => {
|
|||
await user.click(chosenSearchbox);
|
||||
await searchForChosenPackages(chosenSearchbox, 'lib');
|
||||
chosenPackagesItems = within(chosenPackagesList).getAllByRole('option');
|
||||
// eslint-disable-next-line jest-dom/prefer-in-document
|
||||
expect(chosenPackagesItems).toHaveLength(1);
|
||||
|
||||
await user.click(
|
||||
|
|
|
|||
|
|
@ -40,14 +40,6 @@ const routes = [
|
|||
|
||||
let router = undefined;
|
||||
|
||||
// Mocking getComposes is necessary because in many tests we call navigate()
|
||||
// to navigate to the images table (via useNavigate hook), which will in turn
|
||||
// result in a call to getComposes. If it is not mocked, tests fail due to MSW
|
||||
// being unable to resolve that endpoint.
|
||||
// jest
|
||||
// .spyOn(api, 'getComposes')
|
||||
// .mockImplementation(() => Promise.resolve(mockComposesEmpty));
|
||||
|
||||
jest.mock('@redhat-cloud-services/frontend-components/useChrome', () => ({
|
||||
useChrome: () => ({
|
||||
auth: {
|
||||
|
|
@ -333,10 +325,6 @@ describe('Step Upload to AWS', () => {
|
|||
await setUp();
|
||||
const nextButton = await getNextButton();
|
||||
|
||||
// jsdom seems to render the next button differently than the browser. The
|
||||
// next button is enabled briefly during the test. This does not occur in
|
||||
// the browser. Using findByRole instead of getByRole to get the next
|
||||
// button allows us to capture its 'final' state.
|
||||
expect(nextButton).toHaveClass('pf-m-disabled');
|
||||
|
||||
await user.click(
|
||||
|
|
@ -399,32 +387,6 @@ describe('Step Upload to AWS', () => {
|
|||
await clickNext();
|
||||
await clickNext();
|
||||
|
||||
// const composeImage = jest
|
||||
// .spyOn(api, 'composeImage')
|
||||
// .mockImplementation((body) => {
|
||||
// expect(body).toEqual({
|
||||
// distribution: RHEL_9,
|
||||
// image_name: undefined,
|
||||
// customizations: {
|
||||
// packages: undefined,
|
||||
// },
|
||||
// image_requests: [
|
||||
// {
|
||||
// architecture: 'x86_64',
|
||||
// image_type: 'aws',
|
||||
// upload_request: {
|
||||
// type: 'aws',
|
||||
// options: {
|
||||
// share_with_sources: ['123'],
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// });
|
||||
// const id = 'edbae1c2-62bc-42c1-ae0c-3110ab718f5a';
|
||||
// return Promise.resolve({ id });
|
||||
// });
|
||||
|
||||
await user.click(screen.getByRole('button', { name: /Create/ }));
|
||||
|
||||
// returns back to the landing page
|
||||
|
|
@ -501,8 +463,6 @@ describe('Step Upload to Google', () => {
|
|||
const accessKeyId = await screen.findByTestId('input-google-email');
|
||||
expect(accessKeyId).toHaveValue('');
|
||||
expect(accessKeyId).toBeEnabled();
|
||||
|
||||
// expect(accessKeyId).toBeRequired(); // DDf does not support required value
|
||||
});
|
||||
|
||||
test('the google email field must be a valid email', async () => {
|
||||
|
|
@ -853,7 +813,7 @@ describe('Step Details', () => {
|
|||
const nameInput = screen.getByRole('textbox', {
|
||||
name: 'Image Name',
|
||||
});
|
||||
// 101 character name
|
||||
// 64 character name
|
||||
const invalidName = 'a'.repeat(64);
|
||||
await user.type(nameInput, invalidName);
|
||||
expect(await getNextButton()).toHaveClass('pf-m-disabled');
|
||||
|
|
@ -924,7 +884,6 @@ describe('Step Review', () => {
|
|||
await clickNext();
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const setUpCentOS = async () => {
|
||||
({ router } = renderCustomRoutesWithReduxRouter('imagewizard', {}, routes));
|
||||
|
||||
|
|
@ -1254,141 +1213,8 @@ describe('Click through all steps', () => {
|
|||
);
|
||||
expect(within(revtbody).getAllByRole('row')).toHaveLength(3);
|
||||
|
||||
// // mock the backend API
|
||||
// const ids = [];
|
||||
// const composeImage = jest
|
||||
// .spyOn(api, 'composeImage')
|
||||
// .mockImplementation((body) => {
|
||||
// let id;
|
||||
// let expectedbody = {};
|
||||
// if (body.image_requests[0].upload_request.type === 'aws') {
|
||||
// expectedbody = {
|
||||
// distribution: RHEL_8,
|
||||
// image_name: 'my-image-name',
|
||||
// image_description: 'this is a perfect description for image',
|
||||
// image_requests: [
|
||||
// {
|
||||
// architecture: 'x86_64',
|
||||
// image_type: 'aws',
|
||||
// upload_request: {
|
||||
// type: 'aws',
|
||||
// options: {
|
||||
// share_with_accounts: ['012345678901'],
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// customizations: customizations,
|
||||
// };
|
||||
// id = 'edbae1c2-62bc-42c1-ae0c-3110ab718f56';
|
||||
// } else if (body.image_requests[0].upload_request.type === 'gcp') {
|
||||
// expectedbody = {
|
||||
// distribution: RHEL_8,
|
||||
// image_name: 'my-image-name',
|
||||
// image_description: 'this is a perfect description for image',
|
||||
// image_requests: [
|
||||
// {
|
||||
// architecture: 'x86_64',
|
||||
// image_type: 'gcp',
|
||||
// upload_request: {
|
||||
// type: 'gcp',
|
||||
// options: {
|
||||
// share_with_accounts: ['user:test@test.com'],
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// customizations: customizations,
|
||||
// };
|
||||
// id = 'edbae1c2-62bc-42c1-ae0c-3110ab718f57';
|
||||
// } else if (body.image_requests[0].upload_request.type === 'azure') {
|
||||
// expectedbody = {
|
||||
// distribution: RHEL_8,
|
||||
// image_name: 'my-image-name',
|
||||
// image_description: 'this is a perfect description for image',
|
||||
// image_requests: [
|
||||
// {
|
||||
// architecture: 'x86_64',
|
||||
// image_type: 'azure',
|
||||
// upload_request: {
|
||||
// type: 'azure',
|
||||
// options: {
|
||||
// tenant_id: 'b8f86d22-4371-46ce-95e7-65c415f3b1e2',
|
||||
// subscription_id: '60631143-a7dc-4d15-988b-ba83f3c99711',
|
||||
// resource_group: 'testResourceGroup',
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// customizations: customizations,
|
||||
// };
|
||||
// id = 'edbae1c2-62bc-42c1-ae0c-3110ab718f58';
|
||||
// } else if (body.image_requests[0].image_type === 'vsphere-ova') {
|
||||
// expectedbody = {
|
||||
// distribution: RHEL_8,
|
||||
// image_name: 'my-image-name',
|
||||
// image_description: 'this is a perfect description for image',
|
||||
// image_requests: [
|
||||
// {
|
||||
// architecture: 'x86_64',
|
||||
// image_type: 'vsphere-ova',
|
||||
// upload_request: {
|
||||
// type: 'aws.s3',
|
||||
// options: {},
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// customizations: customizations,
|
||||
// };
|
||||
// id = 'edbae1c2-62bc-42c1-ae0c-3110ab718f59';
|
||||
// } else if (body.image_requests[0].image_type === 'guest-image') {
|
||||
// expectedbody = {
|
||||
// distribution: RHEL_8,
|
||||
// image_name: 'my-image-name',
|
||||
// image_description: 'this is a perfect description for image',
|
||||
// image_requests: [
|
||||
// {
|
||||
// architecture: 'x86_64',
|
||||
// image_type: 'guest-image',
|
||||
// upload_request: {
|
||||
// type: 'aws.s3',
|
||||
// options: {},
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// customizations: customizations,
|
||||
// };
|
||||
// id = 'edbae1c2-62bc-42c1-ae0c-3110ab718f5a';
|
||||
// } else if (body.image_requests[0].image_type === 'image-installer') {
|
||||
// expectedbody = {
|
||||
// distribution: RHEL_8,
|
||||
// image_name: 'my-image-name',
|
||||
// image_description: 'this is a perfect description for image',
|
||||
// image_requests: [
|
||||
// {
|
||||
// architecture: 'x86_64',
|
||||
// image_type: 'image-installer',
|
||||
// upload_request: {
|
||||
// type: 'aws.s3',
|
||||
// options: {},
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// customizations: customizations,
|
||||
// };
|
||||
// id = 'edbae1c2-62bc-42c1-ae0c-3110ab718f5b';
|
||||
// }
|
||||
// expect(body).toEqual(expectedbody);
|
||||
|
||||
// ids.unshift(id);
|
||||
// return Promise.resolve({ id });
|
||||
// });
|
||||
|
||||
await user.click(screen.getByRole('button', { name: /Create/ }));
|
||||
|
||||
// API request sent to backend
|
||||
// expect(composeImage).toHaveBeenCalledTimes(6);
|
||||
|
||||
// returns back to the landing page
|
||||
await waitFor(() =>
|
||||
expect(router.state.location.pathname).toBe('/insights/image-builder')
|
||||
|
|
|
|||
|
|
@ -196,7 +196,6 @@ describe('Images Table', () => {
|
|||
await user.click(pageButtons[pageButtons.length - 1]);
|
||||
await screen.findAllByText(/9e7d0d51-7106-42ab-98f2-f89872a9d599/i);
|
||||
|
||||
// rows = await findAllByRole('row');
|
||||
rows = [];
|
||||
table = await screen.findByTestId('images-table');
|
||||
rows = await within(table).findAllByRole('row');
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ describe('Create Share To Regions Modal', () => {
|
|||
expect(shareButton).toBeDisabled();
|
||||
|
||||
const selectToggle = screen.getByRole('button', { name: /menu toggle/i });
|
||||
// eslint-disable-next-line testing-library/no-unnecessary-act
|
||||
await user.click(selectToggle);
|
||||
|
||||
const usEast2 = await screen.findByRole('option', {
|
||||
|
|
@ -101,7 +100,6 @@ describe('Create Share To Regions Modal', () => {
|
|||
const selectToggle = await screen.findByRole('button', {
|
||||
name: /menu toggle/i,
|
||||
});
|
||||
// eslint-disable-next-line testing-library/no-unnecessary-act
|
||||
await user.click(selectToggle);
|
||||
|
||||
// parent region disabled
|
||||
|
|
@ -111,7 +109,6 @@ describe('Create Share To Regions Modal', () => {
|
|||
expect(usEast1).toBeDisabled();
|
||||
|
||||
// close the select again to avoid state update
|
||||
// eslint-disable-next-line testing-library/no-unnecessary-act
|
||||
await user.click(selectToggle);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue