Skip to content
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

docs: fix component testing example #10

Merged
merged 1 commit into from
Jun 27, 2024
Merged

Conversation

sipayRT
Copy link
Member

@sipayRT sipayRT commented Jun 26, 2024

No description provided.

Copy link

github-actions bot commented Jun 26, 2024

✅ Successfully deployed static

@@ -108,25 +108,34 @@ it("should log document", async () => {
}
```

Напишем более сложный тест с рендерингом react компонента:
Напишем более сложный тест с рендерингом react компонента. Для этого сначала напишем небольшой компонент:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут у тебя react с маленькой

export default Component;
```

И напишем сам тест, который будет тестировать наш React-компонент:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А тут React с большой.

Давай сделаем одинаково

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сделал с большой везде

@sipayRT sipayRT force-pushed the sipayrt.doc.component-testing branch from 4430c7c to e77c203 Compare June 26, 2024 19:50
<button onClick={() => setCount(count => count + 1)}>count is {count}</button>
</div>
);
}

export default Component;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно сразу выше написать - export default function Component() {...}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тогда можно и сразу export default function() {...}

@shadowusr
Copy link
Member

Если суть PR в том, что в одном файле не работает, мб это явно подсветить в warning блоке каком-нибудь? Звучит как полезная и неочевидная штука

@sipayRT sipayRT force-pushed the sipayrt.doc.component-testing branch from e77c203 to eb5c73c Compare June 27, 2024 08:57
@sipayRT
Copy link
Member Author

sipayRT commented Jun 27, 2024

Если суть PR в том, что в одном файле не работает, мб это явно подсветить в warning блоке каком-нибудь? Звучит как полезная и неочевидная штука

мы просто это пофиксим. но на момент митапа хочется, чтобы пример уже был рабочим

@sipayRT sipayRT merged commit 134edc0 into master Jun 27, 2024
2 checks passed
@sipayRT sipayRT deleted the sipayrt.doc.component-testing branch June 27, 2024 09:02
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.

4 participants