diff --git a/.github/workflows/cypress-testing.yml b/.github/workflows/cypress-testing.yml
index 5d0b90ed0..4bc0fc99b 100644
--- a/.github/workflows/cypress-testing.yml
+++ b/.github/workflows/cypress-testing.yml
@@ -4,7 +4,7 @@ on:
push:
branches: [master]
pull_request:
- branches: [master, test_cases_wa_group]
+ branches: [master]
jobs:
glific:
@@ -96,7 +96,7 @@ jobs:
git clone https://github.com/glific/cypress-testing.git
echo done. go to dir.
cd cypress-testing
- git checkout main
+ git checkout hsm-templates
cd ..
cp -r cypress-testing/cypress cypress
yarn add cypress@13.6.2
diff --git a/src/App.test.tsx b/src/App.test.tsx
index dd82dfb05..fc08eae6b 100644
--- a/src/App.test.tsx
+++ b/src/App.test.tsx
@@ -1,4 +1,3 @@
-import 'mocks/matchMediaMock';
import { MemoryRouter } from 'react-router-dom';
import { MockedProvider } from '@apollo/client/testing';
import { waitFor, render, screen } from '@testing-library/react';
diff --git a/src/assets/images/AddGreenIcon.svg b/src/assets/images/AddGreenIcon.svg
new file mode 100644
index 000000000..31ff0fb53
--- /dev/null
+++ b/src/assets/images/AddGreenIcon.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/assets/images/icons/CrossIcon.svg b/src/assets/images/icons/CrossIcon.svg
new file mode 100644
index 000000000..06b61d6d2
--- /dev/null
+++ b/src/assets/images/icons/CrossIcon.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/common/RichEditor.tsx b/src/common/RichEditor.tsx
index dfd7c1ed0..dae00eb01 100644
--- a/src/common/RichEditor.tsx
+++ b/src/common/RichEditor.tsx
@@ -40,6 +40,7 @@ export const setDefaultValue = (editor: any, initialValue: any) => {
const paragraph = $createParagraphNode();
paragraph.append($createTextNode(initialValue || ''));
root.append(paragraph);
+ paragraph.selectEnd();
});
};
diff --git a/src/components/UI/Form/AutoComplete/AutoComplete.tsx b/src/components/UI/Form/AutoComplete/AutoComplete.tsx
index abf98f200..4ed28ec89 100644
--- a/src/components/UI/Form/AutoComplete/AutoComplete.tsx
+++ b/src/components/UI/Form/AutoComplete/AutoComplete.tsx
@@ -117,7 +117,7 @@ export const AutoComplete = ({
})();
const getLabel = (option: any) => {
- if (option[optionLabel]) {
+ if (option[optionLabel] || option[optionLabel] === '') {
return option[optionLabel];
}
if (additionalOptionLabel) {
diff --git a/src/components/UI/Form/Calendar/Calendar.test.tsx b/src/components/UI/Form/Calendar/Calendar.test.tsx
index ea621ce4c..a2858d5fb 100644
--- a/src/components/UI/Form/Calendar/Calendar.test.tsx
+++ b/src/components/UI/Form/Calendar/Calendar.test.tsx
@@ -3,6 +3,10 @@ import { backspace } from 'common/test-utils';
import { Calendar } from './Calendar';
import dayjs from 'dayjs';
+afterEach(() => {
+ (window as any).matchMedia = null;
+});
+
const setFieldValueMock = vi.fn();
describe('', () => {
const getProps = () => ({
diff --git a/src/components/UI/Form/DateTimePicker/DateTimePicker.test.tsx b/src/components/UI/Form/DateTimePicker/DateTimePicker.test.tsx
index 81a778d5f..f3591ef5f 100644
--- a/src/components/UI/Form/DateTimePicker/DateTimePicker.test.tsx
+++ b/src/components/UI/Form/DateTimePicker/DateTimePicker.test.tsx
@@ -4,6 +4,10 @@ import { DateTimePicker } from './DateTimePicker';
import dayjs from 'dayjs';
import { userEvent } from '@testing-library/user-event';
+afterEach(() => {
+ (window as any).matchMedia = null;
+});
+
describe('', () => {
const onChangeMock = vi.fn();
const setFieldMock = vi.fn();
diff --git a/src/components/UI/Form/EmojiInput/Editor.test.tsx b/src/components/UI/Form/EmojiInput/Editor.test.tsx
index 727f0befa..832088b12 100644
--- a/src/components/UI/Form/EmojiInput/Editor.test.tsx
+++ b/src/components/UI/Form/EmojiInput/Editor.test.tsx
@@ -1,4 +1,3 @@
-import 'mocks/matchMediaMock';
import { render } from '@testing-library/react';
import { Editor } from './Editor';
import { LexicalWrapper } from 'common/LexicalWrapper';
@@ -10,7 +9,7 @@ const mockIntersectionObserver = class {
disconnect() {}
};
-const handleChange = vi.fn;
+const handleChange = vi.fn();
(window as any).IntersectionObserver = mockIntersectionObserver;
diff --git a/src/components/UI/Form/EmojiInput/EmojiInput.test.tsx b/src/components/UI/Form/EmojiInput/EmojiInput.test.tsx
index 70fdba170..c17bb9b1f 100644
--- a/src/components/UI/Form/EmojiInput/EmojiInput.test.tsx
+++ b/src/components/UI/Form/EmojiInput/EmojiInput.test.tsx
@@ -1,8 +1,8 @@
-import 'mocks/matchMediaMock';
import { render, screen } from '@testing-library/react';
import { EmojiInput } from './EmojiInput';
import userEvent from '@testing-library/user-event';
+import { LexicalWrapper } from 'common/LexicalWrapper';
const setFieldValueMock = vi.fn();
@@ -16,18 +16,20 @@ const mockIntersectionObserver = class {
(window as any).IntersectionObserver = mockIntersectionObserver;
const wrapper = (
-
+
+
+
);
vi.mock('components/UI/EmojiPicker/EmojiPicker', async (importOriginal) => {
diff --git a/src/components/UI/Form/EmojiInput/EmojiInput.tsx b/src/components/UI/Form/EmojiInput/EmojiInput.tsx
index d983497eb..e29870866 100644
--- a/src/components/UI/Form/EmojiInput/EmojiInput.tsx
+++ b/src/components/UI/Form/EmojiInput/EmojiInput.tsx
@@ -6,7 +6,6 @@ import { Editor } from './Editor';
import Styles from './EmojiInput.module.css';
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { $createTextNode, $getSelection, $isRangeSelection } from 'lexical';
-import { LexicalWrapper } from 'common/LexicalWrapper';
export interface EmojiInputProps {
field: { name: string; onChange?: any; value: any; onBlur?: any };
@@ -32,6 +31,7 @@ export const EmojiInput = ({
handleChange,
handleBlur,
translation,
+ form,
...props
}: EmojiInputProps) => {
const [showEmojiPicker, setShowEmojiPicker] = useState(false);
@@ -49,9 +49,13 @@ export const EmojiInput = ({
);
const input = (
-
-
-
+
);
return (
diff --git a/src/components/UI/Form/TimePicker/TimePicker.test.tsx b/src/components/UI/Form/TimePicker/TimePicker.test.tsx
index f53585062..6e1290644 100644
--- a/src/components/UI/Form/TimePicker/TimePicker.test.tsx
+++ b/src/components/UI/Form/TimePicker/TimePicker.test.tsx
@@ -3,6 +3,10 @@ import UserEvent from '@testing-library/user-event';
import { TimePicker } from './TimePicker';
+afterEach(() => {
+ (window as any).matchMedia = null;
+});
+
const setFieldValueMock = vi.fn();
const timePickerProps: any = (disabled: boolean) => {
return {
diff --git a/src/components/UI/Form/WhatsAppEditor/WhatsAppEditor.test.tsx b/src/components/UI/Form/WhatsAppEditor/WhatsAppEditor.test.tsx
index 5b059697b..95f87f411 100644
--- a/src/components/UI/Form/WhatsAppEditor/WhatsAppEditor.test.tsx
+++ b/src/components/UI/Form/WhatsAppEditor/WhatsAppEditor.test.tsx
@@ -1,4 +1,3 @@
-import 'mocks/matchMediaMock';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { vi } from 'vitest';
diff --git a/src/components/UI/MessageDialog/MessageDialog.test.tsx b/src/components/UI/MessageDialog/MessageDialog.test.tsx
index b600f9c78..84862975e 100644
--- a/src/components/UI/MessageDialog/MessageDialog.test.tsx
+++ b/src/components/UI/MessageDialog/MessageDialog.test.tsx
@@ -1,4 +1,3 @@
-import 'mocks/matchMediaMock';
import { fireEvent, render } from '@testing-library/react';
import { MockedProvider } from '@apollo/client/testing';
diff --git a/src/containers/Chat/Chat.test.tsx b/src/containers/Chat/Chat.test.tsx
index c9895901b..05c13e58f 100644
--- a/src/containers/Chat/Chat.test.tsx
+++ b/src/containers/Chat/Chat.test.tsx
@@ -1,5 +1,5 @@
import { cleanup, render, screen, waitFor } from '@testing-library/react';
-import 'mocks/matchMediaMock';
+
import { MockedProvider } from '@apollo/client/testing';
import { setUserSession } from 'services/AuthService';
diff --git a/src/containers/Chat/ChatConversations/ConversationList/ConversationList.test.tsx b/src/containers/Chat/ChatConversations/ConversationList/ConversationList.test.tsx
index 2fafe5a2c..7ae239c96 100644
--- a/src/containers/Chat/ChatConversations/ConversationList/ConversationList.test.tsx
+++ b/src/containers/Chat/ChatConversations/ConversationList/ConversationList.test.tsx
@@ -1,4 +1,3 @@
-import 'mocks/matchMediaMock';
import { MemoryRouter, BrowserRouter as Router } from 'react-router-dom';
import { render, waitFor, screen, fireEvent } from '@testing-library/react';
import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';
diff --git a/src/containers/Chat/ChatInterface/ChatInterface.test.tsx b/src/containers/Chat/ChatInterface/ChatInterface.test.tsx
index 3eb29282c..8bfc55c40 100644
--- a/src/containers/Chat/ChatInterface/ChatInterface.test.tsx
+++ b/src/containers/Chat/ChatInterface/ChatInterface.test.tsx
@@ -1,4 +1,3 @@
-import 'mocks/matchMediaMock';
import { MemoryRouter } from 'react-router-dom';
import { cleanup, fireEvent, render, waitFor } from '@testing-library/react';
import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';
diff --git a/src/containers/Chat/ChatMessages/ChatInput/ChatInput.test.tsx b/src/containers/Chat/ChatMessages/ChatInput/ChatInput.test.tsx
index 8dd9648c0..46afeed58 100644
--- a/src/containers/Chat/ChatMessages/ChatInput/ChatInput.test.tsx
+++ b/src/containers/Chat/ChatMessages/ChatInput/ChatInput.test.tsx
@@ -1,4 +1,3 @@
-import 'mocks/matchMediaMock';
import { MockedProvider } from '@apollo/client/testing';
import { render, waitFor, fireEvent, screen } from '@testing-library/react';
import { vi } from 'vitest';
diff --git a/src/containers/Chat/ChatMessages/ChatMessages.test.tsx b/src/containers/Chat/ChatMessages/ChatMessages.test.tsx
index e6bd31cff..ee92fc5c4 100644
--- a/src/containers/Chat/ChatMessages/ChatMessages.test.tsx
+++ b/src/containers/Chat/ChatMessages/ChatMessages.test.tsx
@@ -1,4 +1,3 @@
-import 'mocks/matchMediaMock';
import { InMemoryCache } from '@apollo/client';
import { MockedProvider } from '@apollo/client/testing';
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
diff --git a/src/containers/Consulting/ConsultingList/ExportConsulting/ExportConsulting.test.tsx b/src/containers/Consulting/ConsultingList/ExportConsulting/ExportConsulting.test.tsx
index 80ac4265d..7fe9658c4 100644
--- a/src/containers/Consulting/ConsultingList/ExportConsulting/ExportConsulting.test.tsx
+++ b/src/containers/Consulting/ConsultingList/ExportConsulting/ExportConsulting.test.tsx
@@ -8,6 +8,10 @@ import { getAllOrganizations } from 'mocks/Organization';
import { getOrganizationList, exportConsulting as exportConsultingMock } from 'mocks/Consulting';
import * as utils from 'common/utils';
+afterEach(() => {
+ (window as any).matchMedia = null;
+});
+
const mocks = [...getAllOrganizations, getOrganizationList, exportConsultingMock];
setUserSession(JSON.stringify({ organization: { id: '1' }, roles: ['Admin'] }));
diff --git a/src/containers/Form/FormLayout.tsx b/src/containers/Form/FormLayout.tsx
index acf268228..b707e273e 100644
--- a/src/containers/Form/FormLayout.tsx
+++ b/src/containers/Form/FormLayout.tsx
@@ -22,6 +22,7 @@ import { organizationHasDynamicRole } from 'common/utils';
import { getUserRole } from 'context/role';
import styles from './FormLayout.module.css';
import { HelpDataProps } from 'common/HelpData';
+import { LexicalWrapper } from 'common/LexicalWrapper';
export interface FormLayoutProps {
deleteItemQuery: DocumentNode;
@@ -536,67 +537,69 @@ export const FormLayout = ({
};
const form = (
-