Skip to content

Commit

Permalink
add test for DOM element configuration in RiskDataCollector
Browse files Browse the repository at this point in the history
  • Loading branch information
abachman committed Nov 28, 2022
1 parent 231622e commit 795642c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/risk-data-collector.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,27 @@ describe('<RiskDataCollector />', function () {
});
});
});

describe('with recurly.configuration', function () {
const configureSpy = jest.spyOn(global.recurly.Recurly.prototype, 'configure');

suppressConsoleErrors();

it('gives form option a DOM Element', function () {
const subject = withRecurlyProvider(
<RiskDataCollector strategy="kount" />
);

expect(() => render(subject)).not.toThrow();
expect(console.error).not.toHaveBeenCalled();
expect(configureSpy).toHaveBeenCalledWith({
fraud: {
kount: {
dataCollector: true,
form: expect.any(Element)
}
}
});
});
});
});

0 comments on commit 795642c

Please sign in to comment.