Skip to content

Commit ca1b8b0

Browse files
committed
fix: merging with develop
1 parent 0989c45 commit ca1b8b0

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

package/src/components/Attachment/__tests__/Attachment.test.js

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { ThemeProvider } from '../../../contexts/themeContext/ThemeContext';
88
import {
99
generateAttachmentAction,
1010
generateAudioAttachment,
11-
generateCardAttachment,
1211
generateFileAttachment,
1312
generateImageAttachment,
1413
} from '../../../mock-builders/generator/attachment';
@@ -107,52 +106,4 @@ describe('Attachment', () => {
107106
expect(handleAction).toHaveBeenCalledTimes(2);
108107
});
109108
});
110-
111-
it('should render "Card" if attachment type is not recognized', async () => {
112-
const { getByTestId } = render(
113-
getAttachmentComponent({
114-
attachment: generateCardAttachment({
115-
type: Date.now().toString(),
116-
}),
117-
}),
118-
);
119-
await waitFor(() => {
120-
expect(getByTestId('card-attachment')).toBeTruthy();
121-
});
122-
});
123-
124-
it('should open the URL in the browser', async () => {
125-
jest.spyOn(Linking, 'canOpenURL').mockImplementation(jest.fn().mockResolvedValue(true));
126-
127-
jest.spyOn(Linking, 'openURL').mockImplementation(jest.fn().mockResolvedValue(false));
128-
129-
const { result, waitFor } = renderHook(() => useGoToURL('www.google.com'));
130-
131-
const [error, openURL] = result.current;
132-
133-
await act(openURL);
134-
135-
await waitFor(() => {
136-
expect(Linking.canOpenURL).toHaveBeenCalled();
137-
expect(error).not.toBeTruthy();
138-
expect(Linking.openURL).toHaveBeenCalled();
139-
});
140-
});
141-
142-
it('should open the URL in the browser when no url', async () => {
143-
jest.spyOn(Linking, 'canOpenURL').mockImplementation(jest.fn().mockResolvedValue(false));
144-
145-
jest.spyOn(Linking, 'openURL').mockImplementation(jest.fn().mockResolvedValue(true));
146-
147-
const { result } = renderHook(() => useGoToURL());
148-
const [, openURL] = result.current;
149-
await act(openURL);
150-
const [error] = result.current;
151-
152-
await waitFor(() => {
153-
expect(Linking.canOpenURL).toHaveBeenCalled();
154-
expect(error).toBeTruthy();
155-
expect(Linking.openURL).toHaveBeenCalled();
156-
});
157-
});
158109
});

0 commit comments

Comments
 (0)