From bcd6ea45ed5cf500fb9b9240c90f4c02fce37040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sun, 21 Mar 2021 16:38:25 +0000 Subject: [PATCH] Fix tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Łukasz Mierzwa --- web/ui/react-app/src/pages/graph/ExpressionInput.test.tsx | 5 ++--- web/ui/react-app/src/pages/graph/QueryStatsView.test.tsx | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/web/ui/react-app/src/pages/graph/ExpressionInput.test.tsx b/web/ui/react-app/src/pages/graph/ExpressionInput.test.tsx index 86970f59e6b..4a3091a92a9 100644 --- a/web/ui/react-app/src/pages/graph/ExpressionInput.test.tsx +++ b/web/ui/react-app/src/pages/graph/ExpressionInput.test.tsx @@ -122,7 +122,7 @@ describe('ExpressionInput', () => { const spyExecuteQuery = jest.fn(); const props = { ...expressionInputProps, executeQuery: spyExecuteQuery }; const wrapper = mount(); - const btn = wrapper.find(Button).filterWhere(btn => btn.hasClass('execute-btn')); + const btn = wrapper.find(Button).filterWhere(btn => btn.props().color === 'primary'); btn.simulate('click'); expect(spyExecuteQuery).toHaveBeenCalledTimes(1); }); @@ -259,9 +259,8 @@ describe('ExpressionInput', () => { const addon = expressionInput.find(InputGroupAddon).filterWhere(addon => addon.prop('addonType') === 'append'); const button = addon .find(Button) - .find('.execute-btn') + .find('.btn-primary') .first(); - expect(button.prop('color')).toEqual('primary'); expect(button.text()).toEqual('Execute'); }); }); diff --git a/web/ui/react-app/src/pages/graph/QueryStatsView.test.tsx b/web/ui/react-app/src/pages/graph/QueryStatsView.test.tsx index e04c914e1a3..04447ac99a0 100755 --- a/web/ui/react-app/src/pages/graph/QueryStatsView.test.tsx +++ b/web/ui/react-app/src/pages/graph/QueryStatsView.test.tsx @@ -11,7 +11,7 @@ describe('QueryStatsView', () => { }; const queryStatsView = shallow(); expect(queryStatsView.prop('className')).toEqual('query-stats'); - expect(queryStatsView.children().prop('className')).toEqual('float-right'); + expect(queryStatsView.children().prop('className')).toEqual('float-right text-secondary'); expect(queryStatsView.children().text()).toEqual('Load time: 100ms   Resolution: 5s   Result series: 10000'); }); });