From 8c6621672c9c8fccceb15e81556128674d468226 Mon Sep 17 00:00:00 2001 From: JulienM Date: Wed, 12 Feb 2020 09:37:02 +0100 Subject: [PATCH] remove bad test --- .../src/button/SaveButton.spec.tsx | 48 +------------------ 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/packages/ra-ui-materialui/src/button/SaveButton.spec.tsx b/packages/ra-ui-materialui/src/button/SaveButton.spec.tsx index 07da3b1a0eb..a4d09863d84 100644 --- a/packages/ra-ui-materialui/src/button/SaveButton.spec.tsx +++ b/packages/ra-ui-materialui/src/button/SaveButton.spec.tsx @@ -3,10 +3,6 @@ import React from 'react'; import expect from 'expect'; import { TestContext } from 'ra-core'; -import Create from '../detail/Create'; -import SimpleForm from '../form/SimpleForm'; -import Toolbar from '../form/Toolbar'; -import TextInput from '../input/TextInput'; import SaveButton from './SaveButton'; describe('', () => { @@ -45,50 +41,8 @@ describe('', () => { /> ); - fireEvent.click(getByLabelText('ra.action.save')); - expect(onSubmit).toHaveBeenCalled(); - }); - - it('should trigger submit action when Enter key if no saving is in progress', () => { - const onSubmit = jest.fn(); - const defaultCreateProps = { - basePath: '/foo', - id: '123', - resource: 'foo', - location: {}, - match: {}, - }; - - const SaveToolbar = props => ( - - - - ); - - const { getByLabelText } = render( - - - }> - - - - - ); - - const input = getByLabelText('Title'); - fireEvent.focus(input); - fireEvent.change(input, { target: { value: 'test' } }); - - const button = getByLabelText('enterButton'); - //console.log(button); - //fireEvent.click(getByLabelText('ra.action.save')); - fireEvent.keyPress(input, { key: 'Enter', keyCode: 13 }); + fireEvent.click(getByLabelText('ra.action.save')); expect(onSubmit).toHaveBeenCalled(); });