@truedat/dd 8.13.6 → 8.13.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/components/GraphGenerationDialog.js +125 -0
- package/src/components/GraphGenerationNotices.js +67 -0
- package/src/components/GraphLoader.js +12 -17
- package/src/components/GraphRedirector.js +4 -4
- package/src/components/LineageGraph.js +38 -49
- package/src/components/LineageRoutes.js +20 -13
- package/src/components/__tests__/GraphGenerationDialog.spec.js +117 -0
- package/src/components/__tests__/GraphGenerationNotices.spec.js +60 -0
- package/src/components/__tests__/GraphGenerationTranslations.spec.js +74 -0
- package/src/components/__tests__/GraphLoader.spec.js +83 -0
- package/src/components/__tests__/LineageGraphInteraction.spec.js +78 -7
- package/src/components/__tests__/__snapshots__/LineageRoutes.spec.js.snap +12 -1
- package/src/components/__tests__/fixtures/graphGenerationMessages.json +28 -0
- package/src/messages/en.js +0 -29
- package/src/messages/es.js +0 -30
- package/src/reducers/__tests__/graphGenerationState.spec.js +113 -0
- package/src/reducers/graphGenerationState.js +113 -0
- package/src/reducers/graphLoading.js +2 -0
- package/src/reducers/index.js +2 -0
- package/src/routines.js +3 -0
- package/src/sagas/__tests__/createGraph.spec.js +57 -122
- package/src/sagas/__tests__/fetchGraph.spec.js +19 -0
- package/src/sagas/createGraph.js +13 -65
- package/src/sagas/fetchGraph.js +6 -38
- package/src/sagas/graph/__tests__/backgroundGraphs.spec.js +22 -0
- package/src/sagas/graph/__tests__/generation.spec.js +247 -0
- package/src/sagas/graph/__tests__/polling.spec.js +88 -0
- package/src/sagas/graph/generation.js +99 -0
- package/src/sagas/graph/polling.js +26 -35
- package/src/sagas/index.js +2 -0
- package/src/styles/LineageGraph.less +117 -0
package/src/routines.js
CHANGED
|
@@ -6,6 +6,7 @@ export const addStructureSelectedFilter = createRoutine(
|
|
|
6
6
|
"ADD_STRUCTURE_SELECTED_FILTER",
|
|
7
7
|
);
|
|
8
8
|
export const applyUserSearchFilter = createRoutine("APPLY_USER_SEARCH_FILTER");
|
|
9
|
+
export const backgroundGraph = createRoutine("BACKGROUND_GRAPH");
|
|
9
10
|
export const bulkUpdateStructures = createRoutine("BULK_UPDATE_STRUCTURES");
|
|
10
11
|
export const cancelPoll = createRoutine("CANCEL_POLL");
|
|
11
12
|
export const checkoutGrantRequest = createRoutine("CHECKOUT_GRANT_REQUEST");
|
|
@@ -66,6 +67,7 @@ export const deleteTag = createRoutine("DELETE_TAG");
|
|
|
66
67
|
export const deleteUserSearchFilter = createRoutine(
|
|
67
68
|
"DELETE_USER_SEARCH_FILTER",
|
|
68
69
|
);
|
|
70
|
+
export const dismissGraphGeneration = createRoutine("DISMISS_GRAPH_GENERATION");
|
|
69
71
|
export const doStructureNoteAction = createRoutine("DO_STRUCTURE_NOTE_ACTION");
|
|
70
72
|
export const downloadCsvGraph = createRoutine("DOWNLOAD_CSV_GRAPH");
|
|
71
73
|
export const downloadReferenceDataset = createRoutine(
|
|
@@ -104,6 +106,7 @@ export const fetchUserSearchFilters = createRoutine(
|
|
|
104
106
|
"FETCH_USER_SEARCH_FILTERS",
|
|
105
107
|
);
|
|
106
108
|
export const filterStructures = createRoutine("FILTER_STRUCTURES");
|
|
109
|
+
export const graphGeneration = createRoutine("GRAPH_GENERATION");
|
|
107
110
|
export const hoverNode = createRoutine("HOVER_NODE");
|
|
108
111
|
export const initSvg = createRoutine("INIT_SVG");
|
|
109
112
|
export const linkStructureToStructure = createRoutine(
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { compile } from "path-to-regexp";
|
|
2
|
-
import {
|
|
2
|
+
import { takeEvery } from "redux-saga/effects";
|
|
3
3
|
import { testSaga } from "redux-saga-test-plan";
|
|
4
4
|
import { apiJson, apiJsonPost, JSON_OPTS } from "@truedat/core/services/api";
|
|
5
5
|
import {
|
|
6
6
|
createGraphRequestSaga,
|
|
7
7
|
createGraphSaga,
|
|
8
|
-
POLLING_CANCELLED,
|
|
9
8
|
selectLineageQuery,
|
|
10
9
|
} from "../createGraph";
|
|
10
|
+
import { generateGraph } from "../graph/generation";
|
|
11
11
|
import { polling } from "../graph/polling";
|
|
12
|
-
import {
|
|
13
|
-
cancelPoll,
|
|
14
|
-
createGraph,
|
|
15
|
-
fetchGraph,
|
|
16
|
-
excludeNode,
|
|
17
|
-
} from "../../routines";
|
|
12
|
+
import { createGraph, excludeNode } from "../../routines";
|
|
18
13
|
import { API_GRAPHS, API_GRAPH_HASH } from "../../api";
|
|
19
14
|
|
|
20
15
|
const graphAcceptedData = {
|
|
@@ -50,8 +45,8 @@ describe("sagas: createGraphRequestSaga", () => {
|
|
|
50
45
|
testSaga(createGraphRequestSaga)
|
|
51
46
|
.next()
|
|
52
47
|
.all([
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
takeEvery(createGraph.TRIGGER, createGraphSaga),
|
|
49
|
+
takeEvery(excludeNode.TRIGGER, createGraphSaga),
|
|
55
50
|
])
|
|
56
51
|
.finish()
|
|
57
52
|
.isDone();
|
|
@@ -68,7 +63,7 @@ describe("sagas: createGraphRequestSaga", () => {
|
|
|
68
63
|
});
|
|
69
64
|
|
|
70
65
|
describe("sagas: createGraphSaga", () => {
|
|
71
|
-
const isRedirected =
|
|
66
|
+
const isRedirected = true;
|
|
72
67
|
|
|
73
68
|
const query = {
|
|
74
69
|
ids: ["BASILEAII_HIST_PROA_MOROSIDAD [ 2 ] [ 1 ].SOBREGIROCAPITAL"],
|
|
@@ -77,74 +72,19 @@ describe("sagas: createGraphSaga", () => {
|
|
|
77
72
|
isRedirected,
|
|
78
73
|
};
|
|
79
74
|
|
|
80
|
-
|
|
81
|
-
data: graphAcceptedData,
|
|
82
|
-
status: 202,
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const graphCreated = {
|
|
86
|
-
data: { ...graphData, isRedirected },
|
|
87
|
-
status: 201,
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
it("should put a success action when uuids are requested and a 201 (created) graph data response is returned", () => {
|
|
91
|
-
expect(() => {
|
|
92
|
-
testSaga(createGraphSaga)
|
|
93
|
-
.next()
|
|
94
|
-
.select(selectLineageQuery)
|
|
95
|
-
.next(query)
|
|
96
|
-
.put(createGraph.request(query))
|
|
97
|
-
.next()
|
|
98
|
-
.call(apiJsonPost, API_GRAPHS, query, JSON_OPTS)
|
|
99
|
-
.next(graphCreated)
|
|
100
|
-
.put(createGraph.success(graphCreated))
|
|
101
|
-
.next()
|
|
102
|
-
.put(createGraph.fulfill())
|
|
103
|
-
.next()
|
|
104
|
-
.isDone();
|
|
105
|
-
}).not.toThrow();
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it("should fork a polling task when uuids are requested and a 202 (accepted) graph hash response is returned. Then, wait for task cancellation.", () => {
|
|
109
|
-
expect(() => {
|
|
110
|
-
testSaga(createGraphSaga)
|
|
111
|
-
.next()
|
|
112
|
-
.select(selectLineageQuery)
|
|
113
|
-
.next(query)
|
|
114
|
-
.put(createGraph.request(query))
|
|
115
|
-
.next()
|
|
116
|
-
.call(apiJsonPost, API_GRAPHS, query, JSON_OPTS)
|
|
117
|
-
.next(graphAccepted)
|
|
118
|
-
.put(fetchGraph.request(graphAccepted))
|
|
119
|
-
.next()
|
|
120
|
-
.fork(polling, createGraph, graphAccepted, isRedirected)
|
|
121
|
-
.next()
|
|
122
|
-
.take(cancelPoll.TRIGGER)
|
|
123
|
-
.next()
|
|
124
|
-
.cancel()
|
|
125
|
-
.next()
|
|
126
|
-
.put(createGraph.fulfill())
|
|
127
|
-
.next()
|
|
128
|
-
.isDone();
|
|
129
|
-
}).not.toThrow();
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it("should put a failure action when the call returns an error", () => {
|
|
133
|
-
const message = "Request failed";
|
|
134
|
-
const error = { message };
|
|
135
|
-
|
|
75
|
+
it("should pass the query and redirect intent to the shared graph generation", () => {
|
|
136
76
|
expect(() => {
|
|
137
77
|
testSaga(createGraphSaga)
|
|
138
78
|
.next()
|
|
139
79
|
.select(selectLineageQuery)
|
|
140
80
|
.next(query)
|
|
141
|
-
.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
81
|
+
.call(
|
|
82
|
+
generateGraph,
|
|
83
|
+
createGraph,
|
|
84
|
+
apiJsonPost,
|
|
85
|
+
[API_GRAPHS, query, JSON_OPTS],
|
|
86
|
+
isRedirected,
|
|
87
|
+
)
|
|
148
88
|
.next()
|
|
149
89
|
.isDone();
|
|
150
90
|
}).not.toThrow();
|
|
@@ -152,8 +92,6 @@ describe("sagas: createGraphSaga", () => {
|
|
|
152
92
|
});
|
|
153
93
|
|
|
154
94
|
describe("generator: polling", () => {
|
|
155
|
-
const isRedirected = false;
|
|
156
|
-
|
|
157
95
|
const graphAccepted = {
|
|
158
96
|
data: graphAcceptedData,
|
|
159
97
|
status: 202,
|
|
@@ -165,67 +103,64 @@ describe("generator: polling", () => {
|
|
|
165
103
|
};
|
|
166
104
|
|
|
167
105
|
const graphCompleted = {
|
|
168
|
-
data:
|
|
106
|
+
data: graphData,
|
|
169
107
|
status: 200,
|
|
170
108
|
};
|
|
171
109
|
|
|
110
|
+
const url = compile(API_GRAPH_HASH)({ hash: graphAccepted.data.graph_hash });
|
|
111
|
+
const progressFor = (retry) => ({
|
|
112
|
+
...graphPending,
|
|
113
|
+
data: {
|
|
114
|
+
...graphPending.data,
|
|
115
|
+
graph_hash: graphAccepted.data.graph_hash,
|
|
116
|
+
retry,
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
|
|
172
120
|
it("polling should keep requesting by graph hash until graph is received", () => {
|
|
121
|
+
const onProgress = jest.fn();
|
|
122
|
+
|
|
173
123
|
expect(() => {
|
|
174
|
-
testSaga(polling,
|
|
124
|
+
testSaga(polling, graphAccepted, onProgress)
|
|
175
125
|
.next()
|
|
176
126
|
.delay(1000)
|
|
177
127
|
.next()
|
|
178
|
-
.call(
|
|
179
|
-
apiJson,
|
|
180
|
-
compile(API_GRAPH_HASH)({ hash: graphAccepted.data.graph_hash }),
|
|
181
|
-
JSON_OPTS,
|
|
182
|
-
)
|
|
128
|
+
.call(apiJson, url, JSON_OPTS)
|
|
183
129
|
.next(graphPending)
|
|
184
|
-
.
|
|
185
|
-
fetchGraph.failure({
|
|
186
|
-
data: { graph_hash: graphAccepted.data.graph_hash, retry: 1 },
|
|
187
|
-
}),
|
|
188
|
-
)
|
|
130
|
+
.call(onProgress, progressFor(1))
|
|
189
131
|
.next()
|
|
190
|
-
.cancelled()
|
|
191
|
-
.next(false)
|
|
192
132
|
.delay(1200)
|
|
193
133
|
.next()
|
|
194
|
-
.call(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
JSON_OPTS,
|
|
198
|
-
)
|
|
199
|
-
.next(graphCompleted)
|
|
200
|
-
.cancelled()
|
|
201
|
-
.next(false)
|
|
202
|
-
.put(createGraph.success(graphCompleted))
|
|
134
|
+
.call(apiJson, url, JSON_OPTS)
|
|
135
|
+
.next(graphPending)
|
|
136
|
+
.call(onProgress, progressFor(2))
|
|
203
137
|
.next()
|
|
204
|
-
.
|
|
138
|
+
.delay(1440)
|
|
139
|
+
.next()
|
|
140
|
+
.call(apiJson, url, JSON_OPTS)
|
|
141
|
+
.next(graphCompleted)
|
|
142
|
+
.returns(graphCompleted);
|
|
205
143
|
}).not.toThrow();
|
|
206
144
|
});
|
|
207
145
|
|
|
208
|
-
it("
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
.next(true)
|
|
228
|
-
.put(createGraph.failure(POLLING_CANCELLED));
|
|
229
|
-
}).not.toThrow();
|
|
146
|
+
it("retries a network error without reporting the previous response as new progress", () => {
|
|
147
|
+
const onProgress = jest.fn();
|
|
148
|
+
testSaga(polling, graphAccepted, onProgress)
|
|
149
|
+
.next()
|
|
150
|
+
.delay(1000)
|
|
151
|
+
.next()
|
|
152
|
+
.call(apiJson, url, JSON_OPTS)
|
|
153
|
+
.next(graphPending)
|
|
154
|
+
.call(onProgress, progressFor(1))
|
|
155
|
+
.next()
|
|
156
|
+
.delay(1200)
|
|
157
|
+
.next()
|
|
158
|
+
.call(apiJson, url, JSON_OPTS)
|
|
159
|
+
.throw(new Error("offline"))
|
|
160
|
+
.delay(1440)
|
|
161
|
+
.next()
|
|
162
|
+
.call(apiJson, url, JSON_OPTS)
|
|
163
|
+
.next(graphCompleted)
|
|
164
|
+
.returns(graphCompleted);
|
|
230
165
|
});
|
|
231
166
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { testSaga } from "redux-saga-test-plan";
|
|
2
|
+
import { apiJson, JSON_OPTS } from "@truedat/core/services/api";
|
|
3
|
+
import { compile } from "path-to-regexp";
|
|
4
|
+
import { fetchGraph } from "../../routines";
|
|
5
|
+
import { API_GRAPH } from "../../api";
|
|
6
|
+
import { fetchGraphSaga } from "../fetchGraph";
|
|
7
|
+
import { generateGraph } from "../graph/generation";
|
|
8
|
+
|
|
9
|
+
test("loading a saved graph uses the shared generation lifecycle", () => {
|
|
10
|
+
const payload = { id: "42" };
|
|
11
|
+
testSaga(fetchGraphSaga, { payload })
|
|
12
|
+
.next()
|
|
13
|
+
.call(generateGraph, fetchGraph, apiJson, [
|
|
14
|
+
compile(API_GRAPH)(payload),
|
|
15
|
+
JSON_OPTS,
|
|
16
|
+
])
|
|
17
|
+
.next()
|
|
18
|
+
.isDone();
|
|
19
|
+
});
|
package/src/sagas/createGraph.js
CHANGED
|
@@ -1,78 +1,26 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import {
|
|
3
|
-
all,
|
|
4
|
-
call,
|
|
5
|
-
cancel,
|
|
6
|
-
fork,
|
|
7
|
-
put,
|
|
8
|
-
select,
|
|
9
|
-
take,
|
|
10
|
-
takeLatest,
|
|
11
|
-
} from "redux-saga/effects";
|
|
2
|
+
import { all, call, select, takeEvery } from "redux-saga/effects";
|
|
12
3
|
import { apiJsonPost, JSON_OPTS } from "@truedat/core/services/api";
|
|
13
|
-
import { excludeNode,
|
|
4
|
+
import { excludeNode, createGraph } from "../routines";
|
|
14
5
|
import { API_GRAPHS } from "../api";
|
|
15
|
-
import {
|
|
6
|
+
import { generateGraph } from "./graph/generation";
|
|
16
7
|
|
|
17
8
|
export const selectLineageQuery = _.prop("lineageQuery");
|
|
18
9
|
|
|
19
|
-
export const POLLING_CANCELLED = "Polling cancelled!";
|
|
20
|
-
|
|
21
10
|
export function* createGraphSaga() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
API_GRAPHS,
|
|
31
|
-
body,
|
|
32
|
-
JSON_OPTS,
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
if (graphAcceptedOrCreated.status === 202) {
|
|
36
|
-
yield put(fetchGraph.request(graphAcceptedOrCreated));
|
|
37
|
-
// starts the task in the background
|
|
38
|
-
const pollingTask = yield fork(
|
|
39
|
-
polling,
|
|
40
|
-
createGraph,
|
|
41
|
-
graphAcceptedOrCreated,
|
|
42
|
-
body.isRedirected,
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
// wait for the user stop action
|
|
46
|
-
yield take(cancelPoll.TRIGGER);
|
|
47
|
-
// user clicked stop. cancel the background task
|
|
48
|
-
// this will cause the forked bgSync task to jump into its finally block
|
|
49
|
-
yield cancel(pollingTask);
|
|
50
|
-
} else if (graphAcceptedOrCreated.status === 201) {
|
|
51
|
-
yield put(
|
|
52
|
-
createGraph.success({
|
|
53
|
-
...graphAcceptedOrCreated,
|
|
54
|
-
data: {
|
|
55
|
-
...graphAcceptedOrCreated.data,
|
|
56
|
-
isRedirected: body.isRedirected,
|
|
57
|
-
},
|
|
58
|
-
}),
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
} catch (error) {
|
|
62
|
-
if (error.response) {
|
|
63
|
-
const { status, data } = error.response;
|
|
64
|
-
yield put(createGraph.failure({ status, data }));
|
|
65
|
-
} else {
|
|
66
|
-
yield put(createGraph.failure(error.message));
|
|
67
|
-
}
|
|
68
|
-
} finally {
|
|
69
|
-
yield put(createGraph.fulfill());
|
|
70
|
-
}
|
|
11
|
+
const body = yield select(selectLineageQuery);
|
|
12
|
+
yield call(
|
|
13
|
+
generateGraph,
|
|
14
|
+
createGraph,
|
|
15
|
+
apiJsonPost,
|
|
16
|
+
[API_GRAPHS, body, JSON_OPTS],
|
|
17
|
+
body.isRedirected,
|
|
18
|
+
);
|
|
71
19
|
}
|
|
72
20
|
|
|
73
21
|
export function* createGraphRequestSaga() {
|
|
74
22
|
yield all([
|
|
75
|
-
|
|
76
|
-
|
|
23
|
+
takeEvery(createGraph.TRIGGER, createGraphSaga),
|
|
24
|
+
takeEvery(excludeNode.TRIGGER, createGraphSaga),
|
|
77
25
|
]);
|
|
78
26
|
}
|
package/src/sagas/fetchGraph.js
CHANGED
|
@@ -1,52 +1,20 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import { compile } from "path-to-regexp";
|
|
3
|
-
import { call,
|
|
3
|
+
import { call, takeEvery } from "redux-saga/effects";
|
|
4
4
|
import { apiJson, JSON_OPTS } from "@truedat/core/services/api";
|
|
5
5
|
import { API_GRAPH } from "../api";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { fetchGraph } from "../routines";
|
|
7
|
+
import { generateGraph } from "./graph/generation";
|
|
8
8
|
|
|
9
9
|
const toApiPath = compile(API_GRAPH);
|
|
10
10
|
|
|
11
11
|
export const selectLineageQuery = _.prop("lineageQuery");
|
|
12
12
|
|
|
13
13
|
export function* fetchGraphSaga({ payload }) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
yield put(fetchGraph.request(payload));
|
|
17
|
-
|
|
18
|
-
/* graph is either new (202 accepted) or 200 OK*/
|
|
19
|
-
const graphAcceptedOrFetched = yield call(apiJson, url, JSON_OPTS);
|
|
20
|
-
|
|
21
|
-
if (graphAcceptedOrFetched.status === 202) {
|
|
22
|
-
yield put(fetchGraph.request(graphAcceptedOrFetched));
|
|
23
|
-
// starts the task in the background
|
|
24
|
-
const pollingTask = yield fork(
|
|
25
|
-
polling,
|
|
26
|
-
fetchGraph,
|
|
27
|
-
graphAcceptedOrFetched,
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
// wait for the user stop action
|
|
31
|
-
yield take(cancelPoll.TRIGGER);
|
|
32
|
-
// user clicked stop. cancel the background task
|
|
33
|
-
// this will cause the forked bgSync task to jump into its finally block
|
|
34
|
-
yield cancel(pollingTask);
|
|
35
|
-
} else if (graphAcceptedOrFetched.status === 200) {
|
|
36
|
-
yield put(yield put(fetchGraph.success(graphAcceptedOrFetched.data)));
|
|
37
|
-
}
|
|
38
|
-
} catch (error) {
|
|
39
|
-
if (error.response) {
|
|
40
|
-
const { status, data } = error.response;
|
|
41
|
-
yield put(fetchGraph.failure({ status, data }));
|
|
42
|
-
} else {
|
|
43
|
-
yield put(fetchGraph.failure(error.message));
|
|
44
|
-
}
|
|
45
|
-
} finally {
|
|
46
|
-
yield put(fetchGraph.fulfill());
|
|
47
|
-
}
|
|
14
|
+
const url = toApiPath(payload);
|
|
15
|
+
yield call(generateGraph, fetchGraph, apiJson, [url, JSON_OPTS]);
|
|
48
16
|
}
|
|
49
17
|
|
|
50
18
|
export function* fetchGraphRequestSaga() {
|
|
51
|
-
yield
|
|
19
|
+
yield takeEvery(fetchGraph.TRIGGER, fetchGraphSaga);
|
|
52
20
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { testSaga } from "redux-saga-test-plan";
|
|
2
|
+
import { watchBackgroundGraphs, selectGeneration } from "../generation";
|
|
3
|
+
import {
|
|
4
|
+
backgroundGraph,
|
|
5
|
+
clearGraph,
|
|
6
|
+
graphGeneration,
|
|
7
|
+
} from "../../../routines";
|
|
8
|
+
|
|
9
|
+
test("does not keep a timer running when no background graph is pending", () => {
|
|
10
|
+
const actions = [
|
|
11
|
+
backgroundGraph.TRIGGER,
|
|
12
|
+
clearGraph.TRIGGER,
|
|
13
|
+
graphGeneration.REQUEST,
|
|
14
|
+
];
|
|
15
|
+
testSaga(watchBackgroundGraphs)
|
|
16
|
+
.next()
|
|
17
|
+
.take(actions)
|
|
18
|
+
.next()
|
|
19
|
+
.select(selectGeneration)
|
|
20
|
+
.next({ jobs: {} })
|
|
21
|
+
.take(actions);
|
|
22
|
+
});
|