Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewards-integration - new action signal names #82

Merged
new unit test for action signal
  • Loading branch information
trickpattyFH20 committed May 25, 2018
commit 565f24603fecdfa768f60b848df90e4f1e27b71d
@@ -87,17 +87,33 @@ describe('app/panel/actions/RewardsActions.js', () => {
expect(actions).toEqual([expectedPayload]);
});

test('sendSignal action should return correctly', () => {
test('sendSignal offer-action-signal should return correctly', () => {
const initialState = {};
const store = mockStore(initialState);

const actionId = 'action_id';
const offerId = 'offer_id';
const origin = 'rewards-panel';
const expectedPayload = { data: { actionId, offerId, origin }, type: SEND_SIGNAL };
const origin = 'rewards-hub';
const type = 'offer-action-signal';
const expectedPayload = { data: { actionId, offerId, origin, type }, type: SEND_SIGNAL };
store.dispatch(rewardsActions.sendSignal(actionId, offerId));

const actions = store.getActions();
expect(actions).toEqual([expectedPayload]);
});

test('sendSignal action-signal should return correctly', () => {
const initialState = {};
const store = mockStore(initialState);

const actionId = 'action_id';
const offerId = undefined;
const origin = 'rewards-hub';
const type = 'action-signal';
const expectedPayload = { data: { actionId, offerId, origin, type }, type: SEND_SIGNAL };
store.dispatch(rewardsActions.sendSignal(actionId));

const actions = store.getActions();
expect(actions).toEqual([expectedPayload]);
});
});
ProTip! Use n and p to navigate between commits in a pull request.