Commit 201d8007 by 张立顺

feat 标签回显修改

1 parent 9277b7a4
Pipeline #235 for 201d8007 failed in 0 seconds
......@@ -10,7 +10,7 @@
<BizTypeTag v-if="detail.bizTypeName"
class="journal-detail__tag"
:biz-type="detail.bizType"
:biz-type-name="detail.bizTypeName" />
:biz-type-name="detail.bizTypeName === '权益' ? '权益延保' : detail.bizTypeName" />
</div>
<div class="journal-detail__body">
<DynamicFormReadonly :detail="detail" />
......
......@@ -7,8 +7,13 @@ const {
getDailyReportDetailSelect,
getDailyReportMerchantBrandIds,
} = require("@api/journalRecord");
const { mount } = require("@vue/test-utils");
const Detail = require("@/views/residentManage/journalRecord/detail.vue").default;
const SlotHost = {
template: "<div><slot /></div>",
};
function createContext(query) {
return {
$route: { query },
......@@ -82,4 +87,33 @@ describe("journalDetail access", () => {
expect(getDailyReportMerchantBrandIds).toHaveBeenCalledWith("1001");
expect(context.detail.brandIds).toEqual([3454]);
});
it("详情页的权益标签应显示为权益延保", () => {
const wrapper = mount({
...Detail,
data() {
return {
pageLoading: false,
detail: {
bizType: 2,
bizTypeName: "权益",
},
journalType: "",
};
},
mounted() {},
}, {
directives: {
loading: {},
},
stubs: {
"d2-container": SlotHost,
"DynamicFormReadonly": true,
"VenusBackButton": true,
},
});
expect(wrapper.find(".biz-type-tag").text()).toBe("权益延保");
wrapper.destroy();
});
});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!