From d3afcc6841915b1378d35e5cc58c6bb1d4a7ee53 Mon Sep 17 00:00:00 2001 From: Rob DiCiuccio Date: Mon, 22 Mar 2021 12:12:49 -0700 Subject: [PATCH] Update tests with realistic chart data --- .../javascripts/middleware/asyncEvent_spec.ts | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/superset-frontend/spec/javascripts/middleware/asyncEvent_spec.ts b/superset-frontend/spec/javascripts/middleware/asyncEvent_spec.ts index c1aedc1554c2d..60ea10f504814 100644 --- a/superset-frontend/spec/javascripts/middleware/asyncEvent_spec.ts +++ b/superset-frontend/spec/javascripts/middleware/asyncEvent_spec.ts @@ -48,7 +48,35 @@ describe('asyncEvent middleware', () => { errors: [{ message: "Error: relation 'foo' does not exist" }], }; const chartData = { - some: 'data', + result: [ + { + cache_key: '199f01f81f99c98693694821e4458111', + cached_dttm: null, + cache_timeout: 86400, + annotation_data: {}, + error: null, + is_cached: false, + query: + 'SELECT product_line AS product_line,\n sum(sales) AS "(Sales)"\nFROM cleaned_sales_data\nGROUP BY product_line\nLIMIT 50000', + status: 'success', + stacktrace: null, + rowcount: 7, + colnames: ['product_line', '(Sales)'], + coltypes: [1, 0], + data: [ + { + product_line: 'Classic Cars', + '(Sales)': 3919615.66, + }, + ], + applied_filters: [ + { + column: '__time_range', + }, + ], + rejected_filters: [], + }, + ], }; const EVENTS_ENDPOINT = 'glob:*/api/v1/async_event/*';