How to use the redux-saga-test-plan/matchers.call.fn function in redux-saga-test-plan

To help you get started, we’ve selected a few redux-saga-test-plan examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cockroachdb / cockroach-gen / pkg / ui / src / redux / statements / statementsSagas.spec.ts View on Github external
it("calls api#createStatementDiagnosticsReport with statement fingerprint as payload", () => {
      const statementFingerprint = "some-id";
      const action = createStatementDiagnosticsReportAction(
        statementFingerprint,
      );
      const diagnosticsReportRequest = new CreateStatementDiagnosticsReportRequest(
        {
          statement_fingerprint: statementFingerprint,
        },
      );

      return expectSaga(createDiagnosticsReportSaga, action)
        .provide([
          [call.fn(createStatementDiagnosticsReport), Promise.resolve()],
        ])
        .call(createStatementDiagnosticsReport, diagnosticsReportRequest)
        .put(createStatementDiagnosticsReportCompleteAction())
        .dispatch(action)
        .run();
    });
  });