From 45db4c26e6eaeb737159bdf3385ec6e91abea3dc Mon Sep 17 00:00:00 2001
From: Avinash Lingaloo <>
Date: Fri, 8 Oct 2021 15:29:58 +0400
Subject: [PATCH] Updated tests
---
.../__snapshots__/index.test.tsx.snap | 4 +
.../__snapshots__/search_bar.test.js.snap | 247 ++++++++++++++++++
app/components/search_bar/search_bar.test.js | 56 ----
.../__snapshots__/add_reaction.test.js.snap | 18 --
.../add_reaction/add_reaction.test.tsx | 24 --
.../options_modal_list.test.tsx.snap | 6 +
6 files changed, 257 insertions(+), 98 deletions(-)
create mode 100644 app/components/search_bar/__snapshots__/search_bar.test.js.snap
delete mode 100644 app/components/search_bar/search_bar.test.js
delete mode 100644 app/screens/add_reaction/__snapshots__/add_reaction.test.js.snap
delete mode 100644 app/screens/add_reaction/add_reaction.test.tsx
rename app/screens/options_modal/{ => components}/__snapshots__/options_modal_list.test.tsx.snap (96%)
diff --git a/app/components/drawer_item/__snapshots__/index.test.tsx.snap b/app/components/drawer_item/__snapshots__/index.test.tsx.snap
index 688eab3bee..a8993c98c7 100644
--- a/app/components/drawer_item/__snapshots__/index.test.tsx.snap
+++ b/app/components/drawer_item/__snapshots__/index.test.tsx.snap
@@ -3,7 +3,9 @@
exports[`DrawerItem should match snapshot 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ cancel title
+
+
+
+
+
+
+
+`;
diff --git a/app/components/search_bar/search_bar.test.js b/app/components/search_bar/search_bar.test.js
deleted file mode 100644
index 6f389c52c4..0000000000
--- a/app/components/search_bar/search_bar.test.js
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
-// See LICENSE.txt for license information.
-
-import React from 'react';
-
-import {shallowWithIntl} from '@test/intl-test-helper';
-
-import SearchBar from './index';
-
-jest.useFakeTimers();
-
-describe('SearchBar', () => {
- const baseProps = {
- onBlur: jest.fn,
- onFocus: jest.fn,
- onSearchButtonPress: jest.fn,
- onChangeText: jest.fn,
- onCancelButtonPress: jest.fn,
- onSelectionChange: jest.fn,
- testID: 'search_bar',
- backgroundColor: '#ffffff',
- placeholderTextColor: '#000000',
- titleCancelColor: '#aaaaaa',
- tintColorSearch: '#bbbbbb',
- tintColorDelete: '#cccccc',
- selectionColor: '#dddddd',
- inputStyle: {},
- containerStyle: {},
- cancelButtonStyle: {},
- autoFocus: true,
- placeholder: 'placeholder',
- cancelTitle: 'cancel title',
- returnKeyType: 'return-key-type',
- keyboardType: 'keyboard-type',
- autoCapitalize: 'auto-capitalize',
- inputHeight: 10,
- editable: true,
- blurOnSubmit: true,
- keyboardShouldPersist: true,
- value: 'value',
- keyboardAppearance: 'keyboard-appearance',
- showArrow: true,
- searchBarRightMargin: 5,
- searchIconSize: 1,
- backArrowSize: 1,
- deleteIconSize: 1,
- showCancel: true,
- containerHeight: 20,
- };
-
- test('should match snapshot', () => {
- const wrapper = shallowWithIntl();
-
- expect(wrapper.getElement()).toMatchSnapshot();
- });
-});
diff --git a/app/screens/add_reaction/__snapshots__/add_reaction.test.js.snap b/app/screens/add_reaction/__snapshots__/add_reaction.test.js.snap
deleted file mode 100644
index 9418dcb1dd..0000000000
--- a/app/screens/add_reaction/__snapshots__/add_reaction.test.js.snap
+++ /dev/null
@@ -1,18 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AddReaction should match snapshot 1`] = `
-
-
-
-`;
diff --git a/app/screens/add_reaction/add_reaction.test.tsx b/app/screens/add_reaction/add_reaction.test.tsx
deleted file mode 100644
index f21fcdf1be..0000000000
--- a/app/screens/add_reaction/add_reaction.test.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
-// See LICENSE.txt for license information.
-
-import React from 'react';
-
-import {renderWithIntl} from '@test/intl-test-helper';
-
-import AddReaction from './index';
-
-describe('AddReaction', () => {
- const baseProps = {
- onEmojiPress: jest.fn(),
- componentId: 'component-id',
- closeButton: {},
- };
-
- test('should match snapshot', () => {
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
- const wrapper = renderWithIntl();
-
- expect(wrapper.toJSON()).toMatchSnapshot();
- });
-});
diff --git a/app/screens/options_modal/__snapshots__/options_modal_list.test.tsx.snap b/app/screens/options_modal/components/__snapshots__/options_modal_list.test.tsx.snap
similarity index 96%
rename from app/screens/options_modal/__snapshots__/options_modal_list.test.tsx.snap
rename to app/screens/options_modal/components/__snapshots__/options_modal_list.test.tsx.snap
index 0054d65a5d..b197dd9ad2 100644
--- a/app/screens/options_modal/__snapshots__/options_modal_list.test.tsx.snap
+++ b/app/screens/options_modal/components/__snapshots__/options_modal_list.test.tsx.snap
@@ -64,7 +64,9 @@ exports[`OptionModalList should match snapshot 1`] = `
>