未验证 提交 e0b4d919 编写于 作者: P Phil Hughes

spec fixes after API axios change

上级 9af1773f
...@@ -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)
......
...@@ -87,8 +87,10 @@ describe('RepoCommitSection', () => { ...@@ -87,8 +87,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({
data: {
short_id: '1', short_id: '1',
stats: {}, stats: {},
},
})); }));
}); });
......
...@@ -250,6 +250,7 @@ describe('Multi-file store actions', () => { ...@@ -250,6 +250,7 @@ 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({
data: {
id: '123456', id: '123456',
short_id: '123', short_id: '123',
message: 'test message', message: 'test message',
...@@ -258,6 +259,7 @@ describe('Multi-file store actions', () => { ...@@ -258,6 +259,7 @@ describe('Multi-file store actions', () => {
additions: '1', additions: '1',
deletions: '2', deletions: '2',
}, },
},
})); }));
}); });
...@@ -324,7 +326,9 @@ describe('Multi-file store actions', () => { ...@@ -324,7 +326,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({
data: {
message: 'failed message', message: 'failed message',
},
})); }));
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册