@@ -225,28 +225,31 @@ describe("Android delivery routing", () => { |
225 | 225 | ["waiting_for_approval", "waiting_for_input", "2 agents need attention", "true"], |
226 | 226 | ["completed", "failed", "2 agents finished", "false"], |
227 | 227 | ] as const) { |
228 | | - it.effect(`groups ${firstPhase} and ${secondPhase} once across their queued jobs`, () => { |
229 | | - const h = harness(); |
230 | | - h.current.otherStates = [secondState]; |
231 | | - return Effect.gen(function* () { |
232 | | - const delivery = yield* FcmDeliveries; |
233 | | - yield* delivery.process(h.job); |
234 | | - h.current.state = { ...state, phase: firstPhase }; |
235 | | - h.current.otherStates = [{ ...secondState, phase: secondPhase }]; |
236 | | - yield* delivery.process({ ...h.job, state: h.current.state }); |
237 | | - yield* delivery.process({ ...h.job, state: h.current.otherStates[0] }); |
238 | | - yield* delivery.process({ ...h.job, state: h.current.state }); |
239 | | - const alerts = h.sent.filter((message) => message.alert); |
240 | | - expect(alerts).toHaveLength(1); |
241 | | - expect(alerts[0]?.data).toMatchObject({ |
242 | | - alert_title: title, |
243 | | - alert_body: "Fix notifications, Second thread", |
244 | | - alert_path: firstPhase === "completed" ? secondState.deepLink : state.deepLink, |
245 | | - active, |
246 | | - }); |
247 | | - expect(h.marked.at(-1)?.aggregate?.activities).toHaveLength(2); |
248 | | - }).pipe(Effect.provide(h.layer)); |
249 | | - }); |
| 228 | + it.effect( |
| 229 | + `routes grouped ${firstPhase} and ${secondPhase} to the overview once across their queued jobs`, |
| 230 | + () => { |
| 231 | + const h = harness(); |
| 232 | + h.current.otherStates = [secondState]; |
| 233 | + return Effect.gen(function* () { |
| 234 | + const delivery = yield* FcmDeliveries; |
| 235 | + yield* delivery.process(h.job); |
| 236 | + h.current.state = { ...state, phase: firstPhase }; |
| 237 | + h.current.otherStates = [{ ...secondState, phase: secondPhase }]; |
| 238 | + yield* delivery.process({ ...h.job, state: h.current.state }); |
| 239 | + yield* delivery.process({ ...h.job, state: h.current.otherStates[0] }); |
| 240 | + yield* delivery.process({ ...h.job, state: h.current.state }); |
| 241 | + const alerts = h.sent.filter((message) => message.alert); |
| 242 | + expect(alerts).toHaveLength(1); |
| 243 | + expect(alerts[0]?.data).toMatchObject({ |
| 244 | + alert_title: title, |
| 245 | + alert_body: "Fix notifications, Second thread", |
| 246 | + alert_path: "/", |
| 247 | + active, |
| 248 | + }); |
| 249 | + expect(h.marked.at(-1)?.aggregate?.activities).toHaveLength(2); |
| 250 | + }).pipe(Effect.provide(h.layer)); |
| 251 | + }, |
| 252 | + ); |
250 | 253 | } |
251 | 254 |
|
252 | 255 | it.effect("filters disabled event types before counting a group", () => { |
|