Skip to content

Commit

Permalink
Merge pull request #2919 from glific/bug/add-to-collection
Browse files Browse the repository at this point in the history
Removed Loading from contact header
  • Loading branch information
akanshaaa19 authored Jun 10, 2024
2 parents fd1b49d + 1b53acd commit b16eb39
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ vi.mock('common/notification', async (importOriginal) => {
test('it should have add contact to collection dialog box ', async () => {
const { getByText, getByTestId } = render(addContacts);

expect(getByTestId('loader')).toBeInTheDocument();

await waitFor(() => {
expect(getByTestId('autocomplete-element')).toBeInTheDocument();
});
Expand All @@ -58,8 +56,6 @@ test('it should have add contact to collection dialog box ', async () => {
test('click on cancel button ', async () => {
const { getByText, getByTestId } = render(addContacts);

expect(getByTestId('loader')).toBeInTheDocument();

await waitFor(() => {
expect(getByTestId('autocomplete-element')).toBeInTheDocument();
});
Expand All @@ -72,8 +68,6 @@ test('click on cancel button ', async () => {
test('save without changing anything', async () => {
const { getByText, getByTestId } = render(addContacts);

expect(getByTestId('loader')).toBeInTheDocument();

await waitFor(() => {
expect(getByTestId('autocomplete-element')).toBeInTheDocument();
});
Expand All @@ -88,8 +82,6 @@ test('save without changing anything', async () => {
test('change value in dialog box', async () => {
const { getByTestId, getAllByTestId } = render(addContacts);

expect(getByTestId('loader')).toBeInTheDocument();

await waitFor(() => {
expect(getByTestId('autocomplete-element')).toBeInTheDocument();
});
Expand All @@ -108,8 +100,6 @@ test('change value in dialog box', async () => {
test('should add contact to collection', async () => {
const { getByTestId, getByText } = render(addContacts);

expect(getByTestId('loader')).toBeInTheDocument();

await waitFor(() => {
expect(getByTestId('autocomplete-element')).toBeInTheDocument();
});
Expand Down Expand Up @@ -142,8 +132,6 @@ const addGroups = (
test('it should have "add group to collection" dialog box ', async () => {
const { getByText, getByTestId } = render(addGroups);

expect(getByTestId('loader')).toBeInTheDocument();

await waitFor(() => {
expect(getByTestId('autocomplete-element')).toBeInTheDocument();
});
Expand All @@ -154,8 +142,6 @@ test('it should have "add group to collection" dialog box ', async () => {
test('should add whatsapp group to collection', async () => {
const { getByTestId, getByText } = render(addGroups);

expect(getByTestId('loader')).toBeInTheDocument();

await waitFor(() => {
expect(getByTestId('autocomplete-element')).toBeInTheDocument();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
} from 'graphql/mutations/Collection';
import { SearchDialogBox } from 'components/UI/SearchDialogBox/SearchDialogBox';
import { GET_WA_GROUPS } from 'graphql/queries/WaGroups';
import { Loading } from 'components/UI/Layout/Loading/Loading';

interface AddToCollectionProps {
collectionId: string | undefined;
Expand All @@ -27,7 +26,7 @@ export const AddToCollection = ({ collectionId, setDialog, groups }: AddToCollec
let updateMutation = groups ? UPDATE_COLLECTION_WA_GROUP : UPDATE_COLLECTION_CONTACTS;
let entity = groups ? 'waGroups' : 'contacts';

const { data: entityData, loading } = useQuery(searchquery, {
const { data: entityData } = useQuery(searchquery, {
variables: groups ? setVariables({}, 50) : setVariables({ name: contactSearchTerm }, 50),
});

Expand Down Expand Up @@ -101,10 +100,6 @@ export const AddToCollection = ({ collectionId, setDialog, groups }: AddToCollec
? t('Add groups to the collection')
: t('Add contacts to the collection');

if (loading) {
return <Loading />;
}

return (
<SearchDialogBox
title={searchDialogTitle}
Expand Down

0 comments on commit b16eb39

Please sign in to comment.