mirror of
https://github.com/apache/superset.git
synced 2026-04-23 18:14:56 +00:00
fix(table-viz): JS error when sort time column (#10250)
This commit is contained in:
@@ -47,7 +47,7 @@ describe('Visualization > Table', () => {
|
||||
cy.get('.chart-container td:nth-child(1)').contains('2008 Q1');
|
||||
// other column with timestamp use raw timestamp
|
||||
cy.get('.chart-container td:nth-child(3)').contains('2008-01-01T00:00:00');
|
||||
cy.get('.chart-container td').contains('other');
|
||||
cy.get('.chart-container td:nth-child(4)').contains('other');
|
||||
});
|
||||
|
||||
it('Format with table_timestamp_format', () => {
|
||||
@@ -74,7 +74,7 @@ describe('Visualization > Table', () => {
|
||||
it('Test table with groupby', () => {
|
||||
cy.visitChartByParams({
|
||||
...VIZ_DEFAULTS,
|
||||
metrics: NUM_METRIC,
|
||||
metrics: [NUM_METRIC, MAX_DS],
|
||||
groupby: ['name'],
|
||||
});
|
||||
cy.verifySliceSuccess({
|
||||
@@ -84,6 +84,29 @@ describe('Visualization > Table', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('Test table with groupby + time column', () => {
|
||||
cy.visitChartByParams({
|
||||
...VIZ_DEFAULTS,
|
||||
include_time: true,
|
||||
granularity_sqla: 'ds',
|
||||
time_grain_sqla: 'P0.25Y',
|
||||
metrics: [NUM_METRIC, MAX_DS],
|
||||
groupby: ['name'],
|
||||
});
|
||||
cy.verifySliceSuccess({
|
||||
waitAlias: '@getJson',
|
||||
querySubstring: /groupby.*name/,
|
||||
chartSelector: 'table',
|
||||
});
|
||||
});
|
||||
|
||||
it('Handle sorting correctly', () => {
|
||||
cy.get('.chart-container th').contains('name').click();
|
||||
cy.get('.chart-container td:nth-child(2):eq(0)').contains('Aaron');
|
||||
cy.get('.chart-container th').contains('Time').click().click();
|
||||
cy.get('.chart-container td:nth-child(1):eq(0)').contains('2008');
|
||||
});
|
||||
|
||||
it('Test table with percent metrics and groupby', () => {
|
||||
const formData = {
|
||||
...VIZ_DEFAULTS,
|
||||
|
||||
Reference in New Issue
Block a user