Skip to content

Commit 1ac276e

Browse files
committedMar 24, 2025
fix tests
1 parent ab1bc46 commit 1ac276e

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed
 

‎packages/browser-tests/cypress/integration/console/schema.spec.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ describe("questdb schema with working tables", () => {
1919
tables.forEach((table) => {
2020
cy.createTable(table);
2121
});
22-
cy.expandTables();
2322
cy.refreshSchema();
2423
});
2524
it("should show all the tables when there are no suspended", () => {
@@ -33,6 +32,7 @@ describe("questdb schema with working tables", () => {
3332
it("should filter the table with input field", () => {
3433
// Table name search
3534
cy.get('input[name="table_filter"]').type("btc_trades");
35+
cy.expandTables();
3636
cy.getByDataHook("schema-search-clear-button").should("exist");
3737
cy.getByDataHook("schema-table-title").should("contain", "btc_trades");
3838
cy.getByDataHook("schema-table-title").should("not.contain", "ź");
@@ -237,6 +237,7 @@ describe("materialized views", () => {
237237
});
238238

239239
it("should create materialized views", () => {
240+
cy.collapseTables();
240241
cy.getByDataHook("expand-tables").contains(`Tables (${tables.length})`);
241242
cy.getByDataHook("expand-materialized-views").contains(
242243
`Materialized views (${materializedViews.length})`
@@ -251,7 +252,10 @@ describe("materialized views", () => {
251252
it("should show the base table and copy DDL for a materialized view", () => {
252253
cy.expandMatViews();
253254
cy.getByDataHook("schema-matview-title").contains("btc_trades_mv").click();
254-
cy.getByDataHook("base-table-name").contains("btc_trades").should("exist");
255+
cy.getByDataHook("schema-row").contains("Base tables").click();
256+
cy.getByDataHook("schema-detail-title")
257+
.contains("btc_trades")
258+
.should("exist");
255259
cy.getByDataHook("schema-matview-title")
256260
.contains("btc_trades_mv")
257261
.rightclick();
@@ -280,9 +284,11 @@ describe("materialized views", () => {
280284
},
281285
(req) => {
282286
req.continue((res) => {
283-
// [view_name, refresh_type, base_table_name, last_refresh_timestamp, view_sql, view_table_dir_name, invalidation_reason, view_status, base_table_txn, applied_base_table_txn]
284-
res.body.dataset[0][6] = "this is an invalidation reason";
285-
res.body.dataset[0][7] = "invalid";
287+
if (res.body && res.body.dataset && res.body.dataset.length > 0) {
288+
// [view_name, refresh_type, base_table_name, last_refresh_timestamp, view_sql, view_table_dir_name, invalidation_reason, view_status, base_table_txn, applied_base_table_txn]
289+
res.body.dataset[0][6] = "this is an invalidation reason";
290+
res.body.dataset[0][7] = "invalid";
291+
}
286292
return res;
287293
});
288294
}

‎packages/browser-tests/questdb

Submodule questdb updated 91 files

‎packages/web-console/src/scenes/Schema/VirtualTables/index.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ export const VirtualTables: FC<VirtualTablesProps> = ({
125125
}
126126
}, [tables, query, filterSuspendedOnly, walTables, tablesExpanded, matViewsExpanded])
127127

128+
useEffect(() => {
129+
if (!tablesExpanded) {
130+
setSectionExpanded(TABLES_GROUP_KEY, true)
131+
forceUpdate()
132+
}
133+
}, [])
134+
128135
if (state.view === View.loading) {
129136
return <Loading />
130137
}

‎packages/web-console/src/scenes/Schema/index.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,13 @@ const Schema = ({
346346
<Panel.Header
347347
afterTitle={
348348
<div style={{ display: "flex", marginRight: "1rem", justifyContent: "space-between", flex: 1 }}>
349-
<Toolbar
350-
suspendedTablesCount={
351-
walTables?.filter((t) => t.suspended).length ?? 0
352-
}
353-
filterSuspendedOnly={filterSuspendedOnly}
354-
setFilterSuspendedOnly={setFilterSuspendedOnly}
355-
/>
349+
<Toolbar
350+
suspendedTablesCount={
351+
walTables?.filter((t) => t.suspended).length ?? 0
352+
}
353+
filterSuspendedOnly={filterSuspendedOnly}
354+
setFilterSuspendedOnly={setFilterSuspendedOnly}
355+
/>
356356
{tables && (
357357
<Box align="center" gap="0">
358358
{selectOpen && (

0 commit comments

Comments
 (0)
Failed to load comments.