From 7fb8c8a1f5148482e0f0c5c10c938f72d36c9c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Mon, 24 Jul 2023 15:21:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DNPM=E7=9A=84=E7=8E=AF?= =?UTF-8?q?=E5=BD=A2=E5=9B=BE=E5=9C=A8=E5=8E=BB=E9=99=A4legend=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=97=E8=A1=A8=E5=90=8E=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84jest=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../charts/npm/NpmEventsByType.test.js | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/test/views/charts2/charts/npm/NpmEventsByType.test.js b/test/views/charts2/charts/npm/NpmEventsByType.test.js index ee2af046..d3c4b6c6 100644 --- a/test/views/charts2/charts/npm/NpmEventsByType.test.js +++ b/test/views/charts2/charts/npm/NpmEventsByType.test.js @@ -31,25 +31,25 @@ function axiosPostAndMounted (data) { } describe('views/charts2/charts/npm/NpmEventsByType.vue测试', () => { - test('类型分类事件统计信息: npm events 类型分类事件图 ', async () => { - axiosPostAndMounted() - - await new Promise(resolve => setTimeout(() => { - // type - const testNode0 = wrapper.get('[test-id="testNode0"]') - const testNode1 = wrapper.get('[test-id="testNode1"]') - - expect(testNode0.text()).toEqual('dns error') - expect(testNode1.text()).toEqual('http error') - - // total - const total0 = wrapper.get('[test-id="total0"]') - const total1 = wrapper.get('[test-id="total1"]') - expect(total0.text()).toEqual('151') - expect(total1.text()).toEqual('32') - resolve() - }, 200)) - }) + // test('类型分类事件统计信息: npm events 类型分类事件图 ', async () => { + // axiosPostAndMounted() + // + // await new Promise(resolve => setTimeout(() => { + // // type + // const testNode0 = wrapper.get('[test-id="testNode0"]') + // const testNode1 = wrapper.get('[test-id="testNode1"]') + // + // expect(testNode0.text()).toEqual('dns error') + // expect(testNode1.text()).toEqual('http error') + // + // // total + // const total0 = wrapper.get('[test-id="total0"]') + // const total1 = wrapper.get('[test-id="total1"]') + // expect(total0.text()).toEqual('151') + // expect(total1.text()).toEqual('32') + // resolve() + // }, 200)) + // }) test('类型分类事件统计信息: npm events 类型分类事件图无数据 ', async () => { axiosPostAndMounted(mockData.empty.data) @@ -59,19 +59,19 @@ describe('views/charts2/charts/npm/NpmEventsByType.vue测试', () => { resolve() }, 200)) }) - test('类型分类事件统计信息: npm events 类型分类事件图无Http Error类型 ', async () => { - const data = JSON.parse(JSON.stringify(mockData.common.data)) - data.data.data.result = data.data.data.result.filter(item => item.eventType !== 'http error') - axiosPostAndMounted(data) - - await new Promise(resolve => setTimeout(() => { - const testNode0 = wrapper.get('[test-id="testNode0"]') - expect(testNode0.text()).toEqual('dns error') - - // total - const total0 = wrapper.get('[test-id="total0"]') - expect(total0.text()).toEqual('151') - resolve() - }, 200)) - }) + // test('类型分类事件统计信息: npm events 类型分类事件图无Http Error类型 ', async () => { + // const data = JSON.parse(JSON.stringify(mockData.common.data)) + // data.data.data.result = data.data.data.result.filter(item => item.eventType !== 'http error') + // axiosPostAndMounted(data) + // + // await new Promise(resolve => setTimeout(() => { + // const testNode0 = wrapper.get('[test-id="testNode0"]') + // expect(testNode0.text()).toEqual('dns error') + // + // // total + // const total0 = wrapper.get('[test-id="total0"]') + // expect(total0.text()).toEqual('151') + // resolve() + // }, 200)) + // }) })