Commit e427d484 authored by Phil Hughes's avatar Phil Hughes

spec fixes after API axios change

parent 2be34788
...@@ -92,7 +92,9 @@ describe('UsersCache', () => { ...@@ -92,7 +92,9 @@ describe('UsersCache', () => {
apiSpy = (query, options) => { apiSpy = (query, options) => {
expect(query).toBe(''); expect(query).toBe('');
expect(options).toEqual({ username: dummyUsername }); expect(options).toEqual({ username: dummyUsername });
return Promise.resolve([dummyUser]); return Promise.resolve({
data: [dummyUser],
});
}; };
UsersCache.retrieve(dummyUsername) UsersCache.retrieve(dummyUsername)
......
...@@ -106,8 +106,10 @@ describe('RepoCommitSection', () => { ...@@ -106,8 +106,10 @@ describe('RepoCommitSection', () => {
changedFiles = JSON.parse(JSON.stringify(vm.$store.getters.changedFiles)); changedFiles = JSON.parse(JSON.stringify(vm.$store.getters.changedFiles));
spyOn(service, 'commit').and.returnValue(Promise.resolve({ spyOn(service, 'commit').and.returnValue(Promise.resolve({
short_id: '1', data: {
stats: {}, short_id: '1',
stats: {},
},
})); }));
}); });
......
...@@ -250,13 +250,15 @@ describe('Multi-file store actions', () => { ...@@ -250,13 +250,15 @@ describe('Multi-file store actions', () => {
describe('success', () => { describe('success', () => {
beforeEach(() => { beforeEach(() => {
spyOn(service, 'commit').and.returnValue(Promise.resolve({ spyOn(service, 'commit').and.returnValue(Promise.resolve({
id: '123456', data: {
short_id: '123', id: '123456',
message: 'test message', short_id: '123',
committed_date: 'date', message: 'test message',
stats: { committed_date: 'date',
additions: '1', stats: {
deletions: '2', additions: '1',
deletions: '2',
},
}, },
})); }));
}); });
...@@ -321,7 +323,9 @@ describe('Multi-file store actions', () => { ...@@ -321,7 +323,9 @@ describe('Multi-file store actions', () => {
describe('failed', () => { describe('failed', () => {
beforeEach(() => { beforeEach(() => {
spyOn(service, 'commit').and.returnValue(Promise.resolve({ spyOn(service, 'commit').and.returnValue(Promise.resolve({
message: 'failed message', data: {
message: 'failed message',
},
})); }));
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment