Bug Fixes: sortBy key and e2e hosts.spec.ts (#2506)

This commit is contained in:
RachelElysia 2021-10-13 14:12:44 -04:00 committed by GitHub
parent 0510075398
commit de1e73b5b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 11 deletions

View file

@ -61,12 +61,9 @@ describe(
// Go to host details page
cy.get('button[title="Online"]').click();
cy.waitUntil(
() => {
return cy.get("span.status").contains(/online/i);
},
{ timeout: 30000, interval: 1000 }
);
cy.wait(3000); // eslint-disable-line cypress/no-unnecessary-waiting
cy.get(".status").contains(/online/i);
}
);

View file

@ -65,8 +65,7 @@ describe(
// delete custom label
cy.get(".manage-hosts__label-block button").last().click();
// Can't figure out how attach findByRole onto modal button
// Can't use findByText because delete button under modal
cy.wait(2000); // eslint-disable-line cypress/no-unnecessary-waiting
cy.get(".manage-hosts__modal-buttons > .button--alert")
.contains("button", /delete/i)
.click();

View file

@ -332,8 +332,11 @@ const ManageHostsPage = ({
}
};
const refetchHosts = (options: IHostCountLoadOptions) => {
const refetchHosts = (options: IHostLoadOptions) => {
retrieveHosts(options);
if (options.sortBy) {
delete options.sortBy;
}
retrieveHostCount(options);
};

View file

@ -10,12 +10,12 @@ export interface ISortOption {
export interface IHostCountLoadOptions {
page?: number;
perPage?: number;
status?: string;
selectedLabels?: string[];
globalFilter?: string;
status?: string;
teamId?: number;
policyId?: number;
policyResponse?: string;
selectedLabels?: string[];
}
export default {