Skip to content

Commit e09114d

Browse files
bjudsoncaptbaritone
authored andcommitted
Split up test for filterBreadcrumbActions
1 parent 388fc6d commit e09114d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

index.test.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,19 +201,21 @@ describe("raven-for-redux", function() {
201201
it("filters actions for breadcrumbs", function() {
202202
context.store.dispatch({ type: "INCREMENT" });
203203
context.store.dispatch({ type: "UNINTERESTING_ACTION" });
204-
context.store.dispatch({ type: "INCREMENT" });
205204
context.store.dispatch({ type: "UNINTERESTING_ACTION" });
205+
Raven.captureMessage("report!");
206+
207+
expect(context.mockTransport).toHaveBeenCalledTimes(1);
208+
const { breadcrumbs } = context.mockTransport.mock.calls[0][0].data;
209+
expect(breadcrumbs.values.length).toBe(1);
210+
});
211+
it("sends action with data.extra even if it was filtered", function() {
206212
context.store.dispatch({ type: "UNINTERESTING_ACTION" });
207213
Raven.captureMessage("report!");
208214

209215
expect(context.mockTransport).toHaveBeenCalledTimes(1);
210-
const {
211-
extra,
212-
breadcrumbs
213-
} = context.mockTransport.mock.calls[0][0].data;
216+
const { extra } = context.mockTransport.mock.calls[0][0].data;
214217
// Even though the action isn't added to breadcrumbs, it should be sent with extra data
215218
expect(extra.lastAction).toEqual({ type: "UNINTERESTING_ACTION" });
216-
expect(breadcrumbs.values.length).toBe(2);
217219
});
218220
});
219221
});

0 commit comments

Comments
 (0)