From 376110d8fd6cda827216cc7deee640790a2d7b07 Mon Sep 17 00:00:00 2001 From: XieZongChen <46394163+amadeus711@users.noreply.github.com> Date: Tue, 23 Nov 2021 02:26:35 -0600 Subject: [PATCH] test(log): update test (#1657) --- src/log/tests/Log.spec.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/log/tests/Log.spec.ts b/src/log/tests/Log.spec.ts index dad79b23b..2f91e3dd6 100644 --- a/src/log/tests/Log.spec.ts +++ b/src/log/tests/Log.spec.ts @@ -31,4 +31,21 @@ describe('n-log', () => { `line-height: ${lineHeight}` ) }) + + it('should work with `lines` `log` prop', async () => { + const wrapper = mount(NLog, { props: { lines: ['test1', 'test2'] } }) + expect(wrapper.find('.n-code').element.children.length).toBe(2) + expect(wrapper.find('.n-code').element.children[0].textContent).toBe( + 'test1' + ) + expect(wrapper.find('.n-code').element.children[1].textContent).toBe( + 'test2' + ) + + await wrapper.setProps({ log: 'test3' }) + expect(wrapper.find('.n-code').element.children.length).toBe(1) + expect(wrapper.find('.n-code').element.children[0].textContent).toBe( + 'test3' + ) + }) })