Skip to content

Testing#33

Open
kalkv wants to merge 2 commits into
akai-org:masterfrom
kalkv:testing
Open

Testing#33
kalkv wants to merge 2 commits into
akai-org:masterfrom
kalkv:testing

Conversation

@kalkv

@kalkv kalkv commented Jan 3, 2021

Copy link
Copy Markdown
Member

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?

test.todo('test');
import React from 'react';
import { render, screen } from '@testing-library/react';
// import userEvent from '@testing-library/user-event';

@roertbb roertbb Feb 25, 2021

Copy link
Copy Markdown
Collaborator

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? 😉

@roertbb

roertbb commented Feb 25, 2021

Copy link
Copy Markdown
Collaborator

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?

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';

@roertbb roertbb Feb 25, 2021

Copy link
Copy Markdown
Collaborator

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',

@roertbb roertbb Feb 25, 2021

Copy link
Copy Markdown
Collaborator

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

@roertbb

roertbb commented Feb 25, 2021

Copy link
Copy Markdown
Collaborator

Ping me on priv next time pls , it can increase the probability I'll 👀 such things sooner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants