Skip to content

Commit

Permalink
test: 更新返回的 ret 值为 Ret 对象
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Aug 31, 2022
1 parent 36342f8 commit 172bd78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions pages/admin/logistics-addresses/new.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ describe(path, () => {
}))
// 提交
.mockImplementationOnce(() => promise5.resolve({
ret: {
code: 1,
},
ret: Ret.suc(),
}));

const {getByLabelText} = render(<MemoryRouter>
Expand Down
7 changes: 3 additions & 4 deletions pages/admin/shipping-tpls/index.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Index from './index';
import {render} from '@testing-library/react';
import {MemoryRouter} from 'react-router';
import $ from 'miaoxing';
import $, {Ret} from 'miaoxing';
import {bootstrap, createPromise, setUrl, resetUrl} from '@mxjs/test';
import {app} from '@mxjs/app';

Expand Down Expand Up @@ -29,8 +29,7 @@ describe(path, () => {
$.http = jest.fn()
// 读取列表数据
.mockImplementationOnce(() => promise.resolve({
ret: {
code: 1,
ret: Ret.suc({
data: [
{
id: 1,
Expand All @@ -40,7 +39,7 @@ describe(path, () => {
updatedAt: '2020-01-01 00:00:00',
},
],
},
}),
}));

const {findByText} = render(<MemoryRouter>
Expand Down

0 comments on commit 172bd78

Please sign in to comment.