-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing #33
base: master
Are you sure you want to change the base?
Testing #33
Conversation
test.todo('test'); | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
// import userEvent from '@testing-library/user-event'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if unused - can be removed? 😉
expect(screen.getByRole('link')).toHaveAttribute('href', event.url); should do the job ;) |
import { render, screen } from '@testing-library/react'; | ||
// import userEvent from '@testing-library/user-event'; | ||
import moment from 'moment'; | ||
import 'moment/locale/en-gb'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need that actually here actually, it would be worth it to do that in setupTests
to make it work for all tests
import ListingItem from './listing-item'; | ||
|
||
const event = { | ||
date: '25.03.2021', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new Date(2021, 2, 25)
would be more suitable to match events coming from events.js
Ping me on priv next time pls , it can increase the probability I'll 👀 such things sooner |
I implemented new tests. I tried to write test whether a element is rendering with correct href attributte value also but I'm afraid that without custom queries it is impossible. Am I wrong?