mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Add e2e tests for export hosts feature (#5895)
This commit is contained in:
parent
e3f1dda641
commit
16209b4ec5
2 changed files with 15 additions and 2 deletions
|
|
@ -29,7 +29,6 @@ describe("Hosts flow", () => {
|
|||
cy.visit("/hosts/manage");
|
||||
|
||||
cy.getAttached(".manage-hosts").within(() => {
|
||||
// cy.getAttached(".manage-hosts__export-btn").click(); // Feature pushed back from 4.13 release
|
||||
cy.contains("button", /add hosts/i).click();
|
||||
});
|
||||
cy.getAttached(".react-tabs").within(() => {
|
||||
|
|
@ -71,6 +70,20 @@ describe("Hosts flow", () => {
|
|||
});
|
||||
}
|
||||
});
|
||||
it(`exports hosts to CSV`, () => {
|
||||
cy.visit("/hosts/manage");
|
||||
cy.getAttached(".manage-hosts").within(() => {
|
||||
cy.getAttached(".manage-hosts__export-btn").click();
|
||||
});
|
||||
if (Cypress.platform !== "win32") {
|
||||
// windows has issues with downloads location
|
||||
const formattedTime = format(new Date(), "yyyy-MM-dd");
|
||||
const filename = `Hosts ${formattedTime}.csv`;
|
||||
cy.readFile(path.join(Cypress.config("downloadsFolder"), filename), {
|
||||
timeout: 5000,
|
||||
});
|
||||
}
|
||||
});
|
||||
it(`hides and shows "Used by" column`, () => {
|
||||
cy.visit("/hosts/manage");
|
||||
cy.getAttached("thead").within(() =>
|
||||
|
|
|
|||
|
|
@ -1281,7 +1281,7 @@ const ManageHostsPage = ({
|
|||
evt.preventDefault();
|
||||
|
||||
const hiddenColumnsStorage = localStorage.getItem("hostHiddenColumns");
|
||||
let currentHiddenColumns;
|
||||
let currentHiddenColumns = [];
|
||||
let visibleColumns;
|
||||
if (hiddenColumnsStorage) {
|
||||
currentHiddenColumns = JSON.parse(hiddenColumnsStorage);
|
||||
|
|
|
|||
Loading…
Reference in a new issue