From 7ad750641a0110223ecbfeb9ca1c1e7b6a8a222f Mon Sep 17 00:00:00 2001 From: Mubbshar Anwar <78487564+mubbsharanwar@users.noreply.github.com> Date: Wed, 14 Apr 2021 15:04:50 +0500 Subject: [PATCH] Base component unit test (#242) * add unit test of base component --- .../tests/BaseComponent.test.jsx | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/common-components/tests/BaseComponent.test.jsx diff --git a/src/common-components/tests/BaseComponent.test.jsx b/src/common-components/tests/BaseComponent.test.jsx new file mode 100644 index 00000000..3da0a96a --- /dev/null +++ b/src/common-components/tests/BaseComponent.test.jsx @@ -0,0 +1,48 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import { IntlProvider } from '@edx/frontend-platform/i18n'; + +import SmallScreenLayout from '../SmallScreenLayout'; +import MediumScreenLayout from '../MediumScreenLayout'; +import LargeScreenLayout from '../LargeScreenLayout'; + +describe('ScreenLayout', () => { + it('should display the form, pass as a child in SmallScreenLayout', () => { + const smallScreen = mount( + + +
+ +
+
+
, + ); + expect(smallScreen.find('form').exists()).toEqual(true); + }); + + it('should display the form, pass as a child in MediumScreenLayout', () => { + const mediumScreen = mount( + + +
+ +
+
+
, + ); + expect(mediumScreen.find('form').exists()).toEqual(true); + }); + + it('should display the form, pass as a child in LargeScreenLayout', () => { + const largeScreen = mount( + + +
+ +
+
+
, + ); + expect(largeScreen.find('form').exists()).toEqual(true); + }); +});