Commit 9277b7a4 by 张立顺

fix bug

1 parent 5c6cc0f2
Pipeline #231 for 9277b7a4 failed in 0 seconds
......@@ -60,7 +60,7 @@
:table-params="tableParams">
<template #bizType="{ scope }">
<BizTypeTag :biz-type="scope.bizType"
:biz-type-name="scope.bizTypeName" />
:biz-type-name="scope.bizTypeName === '权益' ? '权益延保' : scope.bizTypeName" />
</template>
<template #auth-button="{ scope }">
<el-button class="journal-record__detail-btn"
......
......@@ -24,6 +24,37 @@ const SelectStub = {
template: "<div class=\"merchant-select\">{{ placeholder }}</div>",
};
const JournalTableStub = {
name: "D2Table",
render(h) {
const bizTypeSlot = this.$scopedSlots.bizType;
if (!bizTypeSlot) {
return h("div");
}
return h("div", bizTypeSlot({
scope: {
bizType: 2,
bizTypeName: "权益",
},
}));
},
};
const BizTypeTagStub = {
name: "BizTypeTag",
props: {
bizType: {
type: [Number, String],
default: "",
},
bizTypeName: {
type: String,
default: "",
},
},
template: "<div class=\"biz-type-tag-stub\">{{ bizTypeName }}</div>",
};
describe("journalRecord", () => {
afterEach(() => {
jest.clearAllMocks();
......@@ -54,6 +85,32 @@ describe("journalRecord", () => {
wrapper.destroy();
});
it("列表中的权益业务应显示为权益延保", () => {
const wrapper = shallowMount({
...JournalRecord,
mounted() {},
}, {
mocks: {
$route: { query: {} },
$router: { replace: jest.fn(), push: jest.fn() },
},
stubs: {
"BizTypeTag": BizTypeTagStub,
"d2-container": SlotHost,
"d2-search": SlotHost,
"d2-table": JournalTableStub,
"el-button": true,
"el-option": true,
"el-select": SelectStub,
"el-tab-pane": true,
"el-tabs": SlotHost,
},
});
expect(wrapper.find(".biz-type-tag-stub").text()).toBe("权益延保");
wrapper.destroy();
});
it("查看仅有 sceneList 的日报应携带精确场景和业务兜底上下文", async () => {
const row = mapOverviewRow({
id: "report-1",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!