Skip to content

Commit

Permalink
WIP: Update tests suite for the UI refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
insmac committed Sep 22, 2023
1 parent 074b382 commit 8599e04
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 22 deletions.
8 changes: 7 additions & 1 deletion packages/browser-tests/cypress/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,10 @@ Cypress.Commands.add("getSelectedLines", () => cy.get(".selected-text"));

Cypress.Commands.add("getVisibleLines", () => cy.get(".view-lines"));

Cypress.Commands.add("getNotifications", () => cy.get(".notifications"));
Cypress.Commands.add("getCollapsedNotifications", () =>
cy.get('[data-hook="notifications-collapsed"]')
);

Cypress.Commands.add("getExpandedNotifications", () =>
cy.get('[data-hook="notifications-expanded"]')
);
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ describe("errors", () => {
cy.typeQuery(query).runLine();
cy.matchErrorMarkerPosition({ left: 506, width: 42 });

cy.getNotifications().should("contain", "Invalid date");
cy.getCollapsedNotifications().should("contain", "Invalid date");
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ describe("questdb grid", () => {
cy.wait(100);

cy.getGridRows()
.should("have.length", 8)
.should("have.length", 9)
.getGridRow(0)
.should("contain", "1");

cy.getGridViewport().scrollTo("bottom");
cy.getGridRows().should("have.length", 8);
cy.getGridRow(0).should("contain", "93");
cy.getGridRows().should("have.length", 9);
cy.getGridRow(0).should("contain", "92");
cy.matchImageSnapshot();
});

Expand Down

This file was deleted.

8 changes: 5 additions & 3 deletions packages/web-console/src/scenes/Console/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ const Bottom = styled.div`
flex: 1;
`

const ToggleTablesIcon = styled(ChevronDoubleLeft)<{ collapsed: boolean }>`
transform: rotate(${({ collapsed }) => (collapsed ? "180deg" : "0deg")});
const ToggleTablesIcon = styled(ChevronDoubleLeft)<{ splitterbasis: number }>`
transform: rotate(
${({ splitterbasis }) => (splitterbasis === 0 ? "180deg" : "0deg")}
);
`

const viewModes: {
Expand Down Expand Up @@ -109,7 +111,7 @@ const Console = () => {
>
<ToggleTablesIcon
size="16px"
collapsed={resultsSplitterBasis === 0}
splitterbasis={resultsSplitterBasis}
/>
</Button>
}
Expand Down
4 changes: 2 additions & 2 deletions packages/web-console/src/scenes/Notifications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const Notifications = () => {
<TerminalBoxIcon size="18px" />
Log
</Header>
<LatestNotification>
<LatestNotification data-hook="notifications-collapsed">
{isMinimized && lastNotification && (
<Notification isMinimized={true} {...lastNotification} />
)}
Expand All @@ -140,7 +140,7 @@ const Notifications = () => {
</Menu>
{!isMinimized && (
<Content minimized={isMinimized} ref={contentRef}>
<TransitionGroup className="notifications">
<TransitionGroup data-hook="notifications-expanded">
{notifications.map((notification) => (
<Notification
isMinimized={false}
Expand Down
1 change: 1 addition & 0 deletions packages/web-console/src/scenes/Schema/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ const Schema = ({
skin="secondary"
onClick={() => dispatch(actions.console.setActivePanel("import"))}
prefixIcon={<Upload2 size="18px" />}
data-hook="navigation-import-button"
>
Import
</Button>
Expand Down

0 comments on commit 8599e04

Please sign in to comment.