H-43: fix WEB Captain takeover E2E flow (#8)
* test(shangwutong): cover CID rename reliability * H-43: fix WEB Captain takeover flow * H-48: preserve compatible provider model * H-49: make Captain takeover atomic * H-50: prevent duplicate widget initialization --------- Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -2,7 +2,7 @@ export default {
|
||||
computed: {
|
||||
messageContentAttributes() {
|
||||
const { content_attributes: attribute = {} } = this.message;
|
||||
return attribute;
|
||||
return attribute || {};
|
||||
},
|
||||
hasAttachments() {
|
||||
return !!(
|
||||
|
||||
@@ -34,4 +34,11 @@ describe('messageMixin', () => {
|
||||
expect(wrapper.vm.messageContentAttributes).toEqual({});
|
||||
expect(wrapper.vm.hasAttachments).toBe(true);
|
||||
});
|
||||
|
||||
it('normalizes null content attributes', () => {
|
||||
const wrapper = shallowMount(Component, {
|
||||
data: () => ({ message: { content_attributes: null } }),
|
||||
});
|
||||
expect(wrapper.vm.messageContentAttributes).toEqual({});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user