Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 23 additions & 28 deletions apps/spruce/cypress/integration/task/task_logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ describe("task logs", () => {
const taskLogsButton = 'button[id="cy-task-option"]';
const agentLogsButton = 'button[id="cy-agent-option"]';
const systemLogsButton = 'button[id="cy-system-option"]';
const eventLogsButton = 'button[id="cy-event-option"]';
const allLogsButton = 'button[id="cy-all-option"]';
const eventLogsButton = 'button[data-cy="cy-event-option"]';

beforeEach(() => {
cy.visit(LOGS_ROUTE);
Expand Down Expand Up @@ -51,16 +51,6 @@ describe("task logs", () => {
);
});

it("Event logs should not have an HTML button, Raw button, or Parsley button", () => {
cy.get(eventLogsButton).click({ force: true });
cy.get(eventLogsButton)
.should("have.attr", "aria-selected")
.and("eq", "true");
cy.dataCy("html-log-btn").should("not.exist");
cy.dataCy("raw-log-btn").should("not.exist");
cy.dataCy("parsley-log-btn").should("not.exist");
});

it("Should update logtype query param to agent after checking agent radio button", () => {
cy.get(agentLogsButton).click({ force: true });
cy.get(agentLogsButton)
Expand All @@ -72,17 +62,6 @@ describe("task logs", () => {
});
});

it("Should update logtype query param to event after checking event radio button", () => {
cy.get(eventLogsButton).click({ force: true });
cy.get(eventLogsButton)
.should("have.attr", "aria-selected")
.and("eq", "true");
cy.location().should((loc) => {
expect(loc.pathname).to.equal(LOGS_ROUTE);
expect(loc.search).to.include("logtype=event");
});
});

it("Should update logtype query param to system after checking system radio button", () => {
cy.get(systemLogsButton).click({ force: true });
cy.get(systemLogsButton)
Expand All @@ -105,6 +84,21 @@ describe("task logs", () => {
});
});

it("Event logs button should not show Parsley, HTML, or Raw buttons", () => {
cy.get(eventLogsButton).click({ force: true });
cy.dataCy("html-log-btn").should("not.exist");
cy.dataCy("raw-log-btn").should("not.exist");
cy.dataCy("parsley-log-btn").should("not.exist");
});

it("Should update logtype query param to event after clicking event button", () => {
cy.get(eventLogsButton).click({ force: true });
cy.location().should((loc) => {
expect(loc.pathname).to.equal(LOGS_ROUTE);
expect(loc.search).to.include("logtype=event");
});
});

it("Should initially load with task log radio checked when logtype query param is task", () => {
cy.visit(`${LOGS_ROUTE}?logtype=task`);
cy.get(taskLogsButton)
Expand All @@ -129,18 +123,19 @@ describe("task logs", () => {
.should("have.attr", "aria-selected")
.and("eq", "true");
});
it("Should initially load with event log radio checked when logtype query param is event", () => {
cy.visit(`${LOGS_ROUTE}?logtype=event`);
cy.get(eventLogsButton)
.should("have.attr", "aria-selected")
.and("eq", "true");
});
it("Should initially load with all log radio checked when logtype query param is all", () => {
cy.visit(`${LOGS_ROUTE}?logtype=all`);
cy.get(allLogsButton)
.should("have.attr", "aria-selected")
.and("eq", "true");
});
it("Should initially load with event log when logtype query param is event", () => {
cy.visit(`${LOGS_ROUTE}?logtype=event`);
cy.get(eventLogsButton).should("exist");
cy.location().should((loc) => {
expect(loc.search).to.include("logtype=event");
});
});
});

describe("HTML log viewer", () => {
Expand Down
255 changes: 0 additions & 255 deletions apps/spruce/src/pages/task/taskTabs/logs/LogTypes.tsx

This file was deleted.

Loading