Skip to content

Commit 11e9407

Browse files
author
stevegalili
committed
Sanity check failing test in CI 4 - add console.logs
1 parent 70791e5 commit 11e9407

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/cookbook/app/network-requests/PhoneBook.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ export default () => {
1515
const _getAllContacts = async () => {
1616
const _data = await getAllContacts();
1717
setUsersData(_data);
18+
console.log({
19+
_data,
20+
})
1821
};
1922
const _getAllFavorites = async () => {
2023
const _data = await getAllFavorites();
@@ -25,13 +28,16 @@ export default () => {
2528
try {
2629
await Promise.all([_getAllContacts(), _getAllFavorites()]);
2730
} catch (e) {
28-
const message = e instanceof Error ? e.message : JSON.stringify(e);
31+
const message = e instanceof Error ? e.message : 'Something went wrong';
2932
setError(message);
3033
}
3134
};
3235

3336
void run();
3437
}, []);
38+
console.log({
39+
usersData
40+
})
3541

3642
if (error) {
3743
return <Text>An error occurred: {error}</Text>;

examples/cookbook/app/network-requests/__tests__/PhoneBook.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('PhoneBook', () => {
1515
(axios.get as jest.Mock).mockResolvedValue({ data: DATA });
1616
render(<PhoneBook />);
1717

18-
// await waitForElementToBeRemoved(() => screen.getByText(/users data not quite there yet/i));
18+
await waitForElementToBeRemoved(() => screen.getByText(/users data not quite there yet/i));
1919
expect(await screen.findByText('Name: Mrs Ida Kristensen')).toBeOnTheScreen();
2020
expect(await screen.findByText('Email: [email protected]')).toBeOnTheScreen();
2121
expect(await screen.findAllByText(/name/i)).toHaveLength(3);

0 commit comments

Comments
 (0)