Skip to content

Commit 13c6808

Browse files
committed
test(api) test update when load fails
1 parent 0d373a4 commit 13c6808

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

api/actions/__tests__/widget-update-test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ describe('widget update', () => {
3636
});
3737
});
3838

39+
it('fails to load widgets', () => {
40+
sinon.stub(load, 'default').returns(new Promise((resolve, reject) => {
41+
reject('Widget fail to load.');
42+
}));
43+
return update({session: {}, body: {color: 'Blue'}}).
44+
then(
45+
()=> {
46+
},
47+
(err)=> {
48+
expect(err).to.equal('Widget fail to load.');
49+
});
50+
});
51+
3952
it('updates a widget', () => {
4053
sinon.stub(load, 'default').returns(new Promise((resolve) => {
4154
resolve(widgets);

0 commit comments

Comments
 (0)