mirror of https://github.com/buster-so/buster.git
fix broken unit tests
This commit is contained in:
parent
de24ee7539
commit
3a19fa7c4b
|
@ -384,7 +384,8 @@ describe('assetParamsToRoute', () => {
|
||||||
expect(result).toBe(
|
expect(result).toBe(
|
||||||
createBusterRoute({
|
createBusterRoute({
|
||||||
route: BusterRoutes.APP_DASHBOARD_ID,
|
route: BusterRoutes.APP_DASHBOARD_ID,
|
||||||
dashboardId: mockAssetId
|
dashboardId: mockAssetId,
|
||||||
|
secondaryView: 'version-history'
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -443,8 +444,7 @@ describe('assetParamsToRoute', () => {
|
||||||
expect(result).toBe(
|
expect(result).toBe(
|
||||||
createBusterRoute({
|
createBusterRoute({
|
||||||
route: BusterRoutes.APP_DASHBOARD_ID,
|
route: BusterRoutes.APP_DASHBOARD_ID,
|
||||||
dashboardId: mockAssetId,
|
dashboardId: mockAssetId
|
||||||
chatId: mockChatId
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -103,10 +103,28 @@ const createDashboardRoute = ({
|
||||||
versionNumber?: number;
|
versionNumber?: number;
|
||||||
}) => {
|
}) => {
|
||||||
if (chatId) {
|
if (chatId) {
|
||||||
|
if (versionNumber) {
|
||||||
|
return createBusterRoute({
|
||||||
|
route: BusterRoutes.APP_CHAT_ID_DASHBOARD_ID_VERSION_NUMBER,
|
||||||
|
chatId,
|
||||||
|
dashboardId,
|
||||||
|
versionNumber,
|
||||||
|
secondaryView
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return createBusterRoute({
|
return createBusterRoute({
|
||||||
route: BusterRoutes.APP_CHAT_ID_DASHBOARD_ID_VERSION_NUMBER,
|
route: BusterRoutes.APP_CHAT_ID_DASHBOARD_ID,
|
||||||
chatId,
|
chatId,
|
||||||
dashboardId,
|
dashboardId,
|
||||||
|
secondaryView
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (versionNumber) {
|
||||||
|
return createBusterRoute({
|
||||||
|
route: BusterRoutes.APP_DASHBOARD_ID_VERSION_NUMBER,
|
||||||
|
dashboardId,
|
||||||
versionNumber,
|
versionNumber,
|
||||||
secondaryView
|
secondaryView
|
||||||
});
|
});
|
||||||
|
@ -115,7 +133,6 @@ const createDashboardRoute = ({
|
||||||
return createBusterRoute({
|
return createBusterRoute({
|
||||||
route: BusterRoutes.APP_DASHBOARD_ID,
|
route: BusterRoutes.APP_DASHBOARD_ID,
|
||||||
dashboardId,
|
dashboardId,
|
||||||
versionNumber,
|
|
||||||
secondaryView
|
secondaryView
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,7 +10,8 @@ export enum BusterAppRoutes {
|
||||||
APP_METRIC_ID_FILE = '/app/metrics/:metricId/file',
|
APP_METRIC_ID_FILE = '/app/metrics/:metricId/file',
|
||||||
APP_METRIC_ID_RESULTS = '/app/metrics/:metricId/results?secondary_view=:secondaryView',
|
APP_METRIC_ID_RESULTS = '/app/metrics/:metricId/results?secondary_view=:secondaryView',
|
||||||
APP_DASHBOARDS = '/app/dashboards',
|
APP_DASHBOARDS = '/app/dashboards',
|
||||||
APP_DASHBOARD_ID = '/app/dashboards/:dashboardId',
|
APP_DASHBOARD_ID = '/app/dashboards/:dashboardId?secondary_view=:secondaryView',
|
||||||
|
APP_DASHBOARD_ID_VERSION_NUMBER = '/app/dashboards/:dashboardId?dashboard_version_number=:versionNumber&secondary_view=:secondaryView',
|
||||||
APP_DASHBOARD_ID_FILE = '/app/dashboards/:dashboardId/file',
|
APP_DASHBOARD_ID_FILE = '/app/dashboards/:dashboardId/file',
|
||||||
APP_LOGS = '/app/logs',
|
APP_LOGS = '/app/logs',
|
||||||
APP_DATASETS = '/app/datasets',
|
APP_DATASETS = '/app/datasets',
|
||||||
|
@ -77,6 +78,7 @@ export type BusterAppRoutesWithArgs = {
|
||||||
[BusterAppRoutes.APP_DASHBOARD_ID]: {
|
[BusterAppRoutes.APP_DASHBOARD_ID]: {
|
||||||
route: BusterAppRoutes.APP_DASHBOARD_ID;
|
route: BusterAppRoutes.APP_DASHBOARD_ID;
|
||||||
dashboardId: string;
|
dashboardId: string;
|
||||||
|
secondaryView?: DashboardFileViewSecondary;
|
||||||
};
|
};
|
||||||
[BusterAppRoutes.APP_DASHBOARD_ID_FILE]: {
|
[BusterAppRoutes.APP_DASHBOARD_ID_FILE]: {
|
||||||
route: BusterAppRoutes.APP_DASHBOARD_ID_FILE;
|
route: BusterAppRoutes.APP_DASHBOARD_ID_FILE;
|
||||||
|
@ -158,6 +160,13 @@ export type BusterAppRoutesWithArgs = {
|
||||||
route: BusterAppRoutes.APP_CHAT_ID_DASHBOARD_ID;
|
route: BusterAppRoutes.APP_CHAT_ID_DASHBOARD_ID;
|
||||||
chatId: string;
|
chatId: string;
|
||||||
dashboardId: string;
|
dashboardId: string;
|
||||||
|
secondaryView?: DashboardFileViewSecondary;
|
||||||
|
};
|
||||||
|
[BusterAppRoutes.APP_DASHBOARD_ID_VERSION_NUMBER]: {
|
||||||
|
route: BusterAppRoutes.APP_DASHBOARD_ID_VERSION_NUMBER;
|
||||||
|
dashboardId: string;
|
||||||
|
versionNumber: number;
|
||||||
|
secondaryView?: DashboardFileViewSecondary;
|
||||||
};
|
};
|
||||||
[BusterAppRoutes.APP_CHAT_ID_DASHBOARD_ID_VERSION_NUMBER]: {
|
[BusterAppRoutes.APP_CHAT_ID_DASHBOARD_ID_VERSION_NUMBER]: {
|
||||||
route: BusterAppRoutes.APP_CHAT_ID_DASHBOARD_ID_VERSION_NUMBER;
|
route: BusterAppRoutes.APP_CHAT_ID_DASHBOARD_ID_VERSION_NUMBER;
|
||||||
|
|
|
@ -21,10 +21,8 @@ export const pathNameToRoute = (pathName: string, params: any): BusterRoutes =>
|
||||||
[BusterRoutes.APP_DATASETS_ID_OVERVIEW]: BusterRoutes.APP_DATASETS,
|
[BusterRoutes.APP_DATASETS_ID_OVERVIEW]: BusterRoutes.APP_DATASETS,
|
||||||
[BusterRoutes.APP_DATASETS_ID_EDITOR]: BusterRoutes.APP_DATASETS,
|
[BusterRoutes.APP_DATASETS_ID_EDITOR]: BusterRoutes.APP_DATASETS,
|
||||||
[BusterRoutes.APP_TERMS_ID]: BusterRoutes.APP_TERMS,
|
[BusterRoutes.APP_TERMS_ID]: BusterRoutes.APP_TERMS,
|
||||||
[BusterRoutes.APP_METRIC_ID_VERSION_HISTORY_NUMBER]:
|
[BusterRoutes.APP_METRIC_ID_VERSION_NUMBER]: BusterRoutes.APP_METRIC,
|
||||||
BusterRoutes.APP_METRIC_ID_VERSION_HISTORY_NUMBER,
|
[BusterRoutes.APP_DASHBOARD_ID_VERSION_NUMBER]: BusterRoutes.APP_DASHBOARDS
|
||||||
[BusterRoutes.APP_CHAT_ID_DASHBOARD_ID_VERSION_HISTORY_NUMBER]:
|
|
||||||
BusterRoutes.APP_CHAT_ID_DASHBOARD_ID_VERSION_HISTORY_NUMBER
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (route && paramRoutesToParent[route as string]) {
|
if (route && paramRoutesToParent[route as string]) {
|
||||||
|
|
Loading…
Reference in New Issue