Skip to content

Commit

Permalink
update cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
adonispuente committed Jun 7, 2024
1 parent 8c9e231 commit e2279ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/components/GroupSystems/GroupSystems.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
PAGINATION_NEXT,
PT_CONDITIONAL_FILTER_TOGGLE,
PT_BULK_SELECT,
PT_BULK_SELECT_CHECKBOX,
} from '@redhat-cloud-services/frontend-components-utilities';
import _, { cloneDeep } from 'lodash';
import fixtures from '../../../cypress/fixtures/hosts.json';
Expand Down Expand Up @@ -309,7 +310,7 @@ describe('selection and bulk selection', () => {
});

it('can select and deselect systems', () => {
const middleRow = Math.ceil(DEFAULT_ROW_COUNT / 4);
const middleRow = Math.ceil(DEFAULT_ROW_COUNT / 7.5);
selectRowN(middleRow);
checkSelectedNumber(1);
selectRowN(Math.ceil(middleRow / 2));
Expand Down Expand Up @@ -346,7 +347,7 @@ describe('selection and bulk selection', () => {

it('can select none', () => {
selectRowN(1);
cy.get(PT_BULK_SELECT).click(); // open selection dropdown
cy.get(PT_BULK_SELECT_CHECKBOX).click(); // open selection dropdown
cy.get(DROPDOWN_ITEM).contains('Select none (0 items)').click();
checkSelectedNumber(0);
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/GroupsTable/GroupsTable.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ describe('selection and bulk selection', () => {

it('can select none', () => {
selectRowN(1);
cy.get(PT_BULK_SELECT).contains('1 selected').click(); // open selection dropdown
cy.get(PT_BULK_SELECT).contains('1 selected').click().click();
cy.get(PT_BULK_SELECT_LIST).find(MENU_ITEM).eq(1).click();
checkSelectedNumber(0);
});
Expand Down
7 changes: 4 additions & 3 deletions src/routes/InventoryDetail.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ hostInGroup.results[0].system_profile.operating_system.name = 'RHEL';

describe('renders correctly', () => {
before(() => cy.mockWindowInsights());
beforeEach(() => prepareTest());
beforeEach(() => prepareTest(hostInGroup));

it('renders main components for edge host', () => {
cy.get('.ins-entity-detail').should('have.length', 1);
Expand Down Expand Up @@ -133,7 +133,8 @@ describe('rbac integration', () => {
attributeFilter: {
key: 'group.id',
operation: 'equal',
value: null,
//ask about this value
value: 'group-a-id',
},
},
],
Expand All @@ -142,7 +143,7 @@ describe('rbac integration', () => {
})
);

beforeEach(prepareTest);
beforeEach(() => prepareTest(hostInGroup));

it('should enable delete and edit buttons', () => {
cy.contains('Delete').should('exist').and('be.enabled');
Expand Down

0 comments on commit e2279ec

Please sign in to comment.