From c2685a85df0354e447667882c3be802c8971fd59 Mon Sep 17 00:00:00 2001 From: kasmine Date: Mon, 8 Feb 2021 12:25:54 +0800 Subject: [PATCH] fix: test fail --- __tests__/unit/plots/bar/change-data-spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/__tests__/unit/plots/bar/change-data-spec.ts b/__tests__/unit/plots/bar/change-data-spec.ts index c67bbcab0a..f353c3c6cf 100644 --- a/__tests__/unit/plots/bar/change-data-spec.ts +++ b/__tests__/unit/plots/bar/change-data-spec.ts @@ -110,8 +110,9 @@ describe('bar', () => { const elements = dualAxes.chart.geometries[0].elements; expect(elements.length).toBe(data.length); expect(elements[0].shape.attr('fill')).toBe(elements[1].shape.attr('fill')); - expect(elements[0].getModel().data).toMatchObject(data[0]); - expect(elements[1].getModel().data).toEqual(data[2]); + // 从下至上绘制 + expect(elements[0].getModel().data).toMatchObject(data[data.length - 1]); + expect(elements[1].getModel().data).toEqual(data[data.length - 2]); dualAxes.destroy(); });