Skip to content

Commit dfca2fd

Browse files
e32e Test: add decimal type to duckDB test (#6731)
### Intent In support of #5169, adding support for decimal types in duckdb Had to add a new test in teh describe block as the current testscases assume it's using the flights data files. ### QA Notes @:data-explorer All Tests should pass <!-- Add additional information for QA on how to validate the change, paying special attention to the level of risk, adjacent areas that could be affected by the change, and any important contextual information not present in the linked issues. -->
1 parent 535cd6a commit dfca2fd

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

test/e2e/tests/data-explorer/data-explorer-headless.test.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ test.use({
1212
});
1313

1414
const testCases = [
15-
{ name: 'parquet', file: 'flights.parquet', copyValue: '2013' },
16-
{ name: 'csv', file: 'flights.csv', copyValue: '0' },
17-
{ name: 'gzipped csv', file: 'flights.csv.gz', copyValue: '0' },
18-
{ name: 'tsv', file: 'flights.tsv', copyValue: '0' },
19-
{ name: 'gzipped tsv', file: 'flights.tsv.gz', copyValue: '0' }
15+
{ name: 'parquet', file: 'data-files/flights/flights.parquet', copyValue: '2013' },
16+
{ name: 'csv', file: 'data-files/flights/flights.csv', copyValue: '0' },
17+
{ name: 'gzipped csv', file: 'data-files/flights/flights.csv.gz', copyValue: '0' },
18+
{ name: 'tsv', file: 'data-files/flights/flights.tsv', copyValue: '0' },
19+
{ name: 'gzipped tsv', file: 'data-files/flights/flights.tsv.gz', copyValue: '0' }
2020
];
2121

2222
const plainTextTestCases = [
@@ -34,8 +34,8 @@ test.describe('Headless Data Explorer', {
3434

3535
testCases.forEach(({ name, file, copyValue }) => {
3636
test(`Verify can open and view data with large ${name} file`, async function ({ app, openDataFile }) {
37-
await openDataFile(join(`data-files/flights/${file}`));
38-
await app.workbench.dataExplorer.verifyTab(file, { isVisible: true, isSelected: true });
37+
await openDataFile(`${file}`);
38+
await app.workbench.dataExplorer.verifyTab(file.split('/').pop()!, { isVisible: true, isSelected: true });
3939
await verifyCopyFromCell(app, copyValue);
4040
await verifyDataIsPresent(app);
4141
await verifyPlainTextButtonInActionBar(app, file.endsWith('.csv') || file.endsWith('.tsv'));
@@ -50,6 +50,21 @@ test.describe('Headless Data Explorer', {
5050
await verifyCanOpenAsPlaintext(app, searchString);
5151
});
5252
});
53+
54+
test(`Verify can open parquet decimal data`, async function ({ app, openDataFile }) {
55+
await openDataFile(`data-files/misc-parquet/decimal_types.parquet`);
56+
await app.workbench.dataExplorer.verifyTab('decimal_types.parquet', { isVisible: true, isSelected: true });
57+
await verifyCopyFromCell(app, '123456789012345.678');
58+
await expect(async () => {
59+
// Validate full grid by checking bottom right corner data
60+
await app.workbench.dataExplorer.clickLowerRightCorner();
61+
const tableData = await app.workbench.dataExplorer.getDataExplorerTableData();
62+
const lastRow = tableData.at(-2);
63+
const lastHour = lastRow!['decimal_no_scale'];
64+
expect(lastHour).toBe(`5555555555`);
65+
}).toPass();
66+
}
67+
);
5368
});
5469

5570

0 commit comments

Comments
 (0)