Skip to content

Commit

Permalink
update test to include state.configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mtuchi committed Aug 1, 2023
1 parent c31fa0a commit 2c66b53
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/mailchimp/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ const { execute, post } = Adaptor;

describe('execute', () => {
it('executes each operation in sequence', done => {
let state = {};
let state = {
configuration: {
apiKey: 'somEThINGkeyish',
server: 'https://mailchimp.com/api',
},
};
let operations = [
state => {
return { counter: 1 };
Expand All @@ -31,12 +36,17 @@ describe('execute', () => {
});

it('assigns references, data to the initialState', () => {
let state = {};
let state = {
configuration: {
apiKey: 'somEThINGkeyish',
server: 'https://mailchimp.com/api',
},
};

let finalState = execute()(state);

execute()(state).then(finalState => {
expect(finalState).to.eql({ references: [], data: null });
expect(finalState).to.eql({ ...state, references: [], data: null });
});
});
});
Expand Down

0 comments on commit 2c66b53

Please sign in to comment.