Skip to content
Snippets Groups Projects
Commit e9c681fe authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Fix failing tests and linters

parent a8d25848
Branches
Tags
No related merge requests found
......@@ -169,9 +169,9 @@ export const XRayApi = {
segment_xray: GET("/api/x-ray/segment/:segmentId"),
card_xray: GET("/api/x-ray/card/:cardId"),
field_compare: GET("/api/x-ray/compare/field/:fieldId1/field/:fieldId2"),
table_compare: GET("/api/x-ray/compare/table/:tableId1/table/:tableId2"),
segment_compare: GET("/api/x-ray/compare/segment/:segmentId1/segment/:segmentId2"),
field_compare: GET("/api/x-ray/compare/fields/:fieldId1/:fieldId2"),
table_compare: GET("/api/x-ray/compare/tables/:tableId1/:tableId2"),
segment_compare: GET("/api/x-ray/compare/segments/:segmentId1/:segmentId2"),
segment_table_compare: GET("/api/x-ray/compare/segment/:segmentId/table/:tableId"),
segment_field_compare: GET("/api/x-ray/compare/segment/:segmentId1/segment/:segmentId2/field/:fieldName"),
segment_table_field_compare: GET("/api/x-ray/compare/segment/:segmentId/table/:tableId/field/:fieldName"),
......
......@@ -24,7 +24,7 @@ import {
import Constituent from 'metabase/xray/components/Constituent'
import LoadingAnimation from 'metabase/xray/components/LoadingAnimation'
import { hasXray, xrayLoadingMessages } from 'metabase/xray/utils'
import { xrayLoadingMessages } from 'metabase/xray/utils'
import { ComparisonDropdown } from "metabase/xray/components/ComparisonDropdown";
type Props = {
......
......@@ -68,7 +68,7 @@ export const fetchSegmentComparison = createThunkAction(FETCH_SEGMENT_COMPARISON
)
export const FETCH_SEGMENT_TABLE_COMPARISON = 'metabase/xray/FETCH_SEGMENT_COMPARISON';
export const FETCH_SEGMENT_TABLE_COMPARISON = 'metabase/xray/FETCH_SEGMENT_TABLE_COMPARISON';
const segmentTableComparisonXrayRequest = new BackgroundJobRequest({
creationEndpoint: XRayApi.segment_table_compare,
resultPropName: 'comparison',
......@@ -97,5 +97,6 @@ export default handleActions({
...cardXrayRequest.getReducers(),
...segmentComparisonXrayRequest.getReducers(),
...segmentTableComparisonXrayRequest.getReducers(),
...tableComparisonXrayRequest.getReducers(),
[INITIALIZE]: () => tableXrayRequest.getDefaultState(),
}, tableXrayRequest.getDefaultState())
......@@ -196,20 +196,20 @@ describe("xray integration tests", () => {
const leftSideDropdown = comparisonDropdowns.at(0)
const rightSideDropdown = comparisonDropdowns.at(1)
// left side should be be table and show only segments options as comparision options atm
click(leftSideDropdown.find(ItemLink))
const leftSidePopover = leftSideDropdown.find(TestPopover)
console.log(leftSidePopover.debug())
expect(leftSidePopover.find(`a[href="/xray/compare/segments/${segmentId2}/${segmentId}/approximate"]`).length).toBe(1)
// should filter out the current segment
expect(leftSidePopover.find(`a[href="/xray/compare/segments/${segmentId}/${segmentId}/approximate"]`).length).toBe(0)
expect(leftSidePopover.find(`a[href="/xray/compare/segment/${segmentId}/table/1/approximate"]`).length).toBe(0)
// should filter out the current table
expect(leftSidePopover.find(`a[href="/xray/compare/tables/1/1/approximate"]`).length).toBe(0)
// right side should be be table and show only segments options as comparision options atm
click(rightSideDropdown.find(ItemLink))
const rightSidePopover = rightSideDropdown.find(TestPopover)
console.log(rightSidePopover.debug())
expect(rightSidePopover.find(`a[href="/xray/compare/segments/${segmentId2}/${segmentId}/approximate"]`).length).toBe(0)
// should filter out the current table
expect(rightSidePopover.find(`a[href="/xray/compare/tables/1/1/approximate"]`).length).toBe(0)
expect(rightSidePopover.find(`a[href="/xray/compare/segments/${segmentId}/${segmentId2}/approximate"]`).length).toBe(1)
// should filter out the current segment
expect(rightSidePopover.find(`a[href="/xray/compare/segments/${segmentId}/${segmentId}/approximate"]`).length).toBe(0)
})
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment