|
@@ -47,17 +47,17 @@ describe('ChatRoom', () => {
|
47
|
47
|
to: 'tojid',
|
48
|
48
|
from: 'fromjid'
|
49
|
49
|
})
|
50
|
|
- .c('user-agent').t('user-agent-text').up();
|
|
50
|
+ .c('element-name').t('element-name-text').up();
|
51
|
51
|
|
52
|
52
|
parser.packet2JSON(p.tree(), nodes);
|
53
|
53
|
|
54
|
54
|
expect(nodes.length).toBe(1);
|
55
|
|
- const userAgent = nodes.find(n => n.tagName === 'user-agent');
|
|
55
|
+ const elem = nodes.find(n => n.tagName === 'element-name');
|
56
|
56
|
|
57
|
|
- expect(userAgent).toBeTruthy();
|
58
|
|
- expect(Object.keys(userAgent.attributes).length).toEqual(0);
|
59
|
|
- expect(userAgent.children.length).toEqual(0);
|
60
|
|
- expect(userAgent.value).toEqual('user-agent-text');
|
|
57
|
+ expect(elem).toBeTruthy();
|
|
58
|
+ expect(Object.keys(elem.attributes).length).toEqual(0);
|
|
59
|
+ expect(elem.children.length).toEqual(0);
|
|
60
|
+ expect(elem.value).toEqual('element-name-text');
|
61
|
61
|
});
|
62
|
62
|
|
63
|
63
|
it('translates elements with children correctly', () => {
|