Skip to content

Commit 4d6fee7

Browse files
zero-yearsNoiseFan
andauthored
docs(cn): translate guide/browser/assertion-api (#832)
* Docs(guide/browser/assertion): translate guide/browser/assertion-api * fix: typo * fix: typo --------- Co-authored-by: noise <[email protected]>
1 parent 17287b1 commit 4d6fee7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

guide/browser/assertion-api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,12 @@ await expect.element(
304304
function toBeInViewport(options: { ratio?: number }): Promise<void>
305305
```
306306

307-
This allows you to check if an element is currently in viewport with [IntersectionObserver API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
307+
允许你通过 [IntersectionObserver API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) 检查元素是否在当前视口中。
308308

309-
You can pass `ratio` argument as option, which means the minimal ratio of the element should be in viewport. `ratio` should be in 0~1.
309+
你可以通过参数 `ratio`,将视口中元素的最小比例设置为 `ratio``ratio` 的取值范围为 0~1
310310

311-
该方法通过 IntersectionObserver API检测元素是否位于当前视口内
312-
可通过 ratio参数指定元素在视口中的最小可见比例(取值范围为 0~1):
311+
该方法通过 IntersectionObserver API 检测元素是否位于当前视口内
312+
可通过 ratio 参数指定元素在视口中的最小可见比例(取值范围为 0~1):
313313
```ts
314314
// 检测指定元素是否在视口中
315315
await expect.element(page.getByText('Welcome')).toBeInViewport()

0 commit comments

Comments
 (0)