Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b1ce2fe

Browse filesBrowse files
authored
docs(wrapper-array): add is warning (#1920)
1 parent f812920 commit b1ce2fe
Copy full SHA for b1ce2fe

File tree

3 files changed

+45
-0
lines changed
Filter options
  • docs
    • fr/api/wrapper-array
    • ja/api/wrapper-array
    • zh/api/wrapper-array

3 files changed

+45
-0
lines changed

‎docs/fr/api/wrapper-array/is.md

Copy file name to clipboardExpand all lines: docs/fr/api/wrapper-array/is.md
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
## is
22

3+
::: warning Avertissement de déprédation
4+
L'utilisation de `is` pour affirmer que le nœud DOM est déprécié et sera supprimé.
5+
6+
Considérez un appariement personnalisé tel que ceux fournis dans [jest-dom](https://github.com/testing-library/jest-dom#custom-matchers).
7+
ou pour l'assertion de type d'élément DOM, utilisez native [`Element.tagName`](https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName) à la place.
8+
9+
Pour conserver ces tests, un remplacement valable pour :
10+
11+
- `is('DOM_SELECTOR')` est une affirmation de `wrapper.wrappers.every(wrapper => wrapper.element.tagName === 'DOM_SELECTOR')`.
12+
- `is('ATTR_NAME')` est une affirmation véridique d `wrapper.wrappers.every(wrapper => wrapper.attributes('ATTR_NAME'))`.
13+
- `is('CLASS_NAME')` est une affirmation véridique d `wrapper.wrappers.every(wrapper => wrapper.classes('CLASS_NAME'))`.
14+
15+
L'affirmation contre la définition du composant n'est pas dépréciée
16+
17+
En cas d'utilisation avec findComponent, accédez à l'élément DOM avec `findComponent(Comp).element`
18+
:::
19+
320
Affirmer que chaque `Wrapper` dans le noeud DOM `WrapperArray` ou `vm` correspond à [selector](../selectors.md).
421

522
- **Arguments:**

‎docs/ja/api/wrapper-array/is.md

Copy file name to clipboardExpand all lines: docs/ja/api/wrapper-array/is.md
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
## is(selector)
22

3+
::: warning Deprecation warning
4+
`is` を使用して、 DOM ノードまたは `vm` がセレクタに一致することをアサートするのは非推奨となり、削除される予定です。
5+
6+
[jest-dom](https://github.com/testing-library/jest-dom#custom-matchers) で提供されているようなカスタムマッチャの使用を検討してください。または、 DOM 要素などに対するアサーションには、代わりにネイティブの [Element.tagName](https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName) を使用してください。
7+
8+
テストを維持するためには、以下の置き換えが有効です。
9+
10+
- `is('DOM_SELECTOR')``wrapper.wrappers.every(wrapper => wrapper.element.tagName === 'DOM_SELECTOR')` のアサーションです。
11+
- `is('ATTR_NAME')` は真に `wrapper.wrappers.every(wrapper => wrapper.attributes('ATTR_NAME'))` のアサーションです。
12+
- `is('CLASS_NAME')` は真に `wrapper.wrappers.every(wrapper => wrapper.classes('CLASS_NAME'))` のアサーションです。
13+
14+
findComponent で使用する場合は、 `findComponent(Comp).element` で DOM 要素にアクセスします。
15+
:::
16+
317
`WrapperArray` の全ての `Wrapper` の DOM ノード、もしくは[セレクタ](../selectors.md)`vm` とマッチするか検証します。
418

519
- **引数:**

‎docs/zh/api/wrapper-array/is.md

Copy file name to clipboardExpand all lines: docs/zh/api/wrapper-array/is.md
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
## is
22

3+
::: warning 废弃警告
4+
使用 `is` 断言 DOM 结点或 `vm` 匹配选择器的方式已经被废弃并会被移除。
5+
6+
可以考虑一个诸如 [jest-dom](https://github.com/testing-library/jest-dom#custom-matchers) 提供的自定义匹配。或为 DOM 元素类型断言换用原生的 [`Element.tagName`](https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName)
7+
8+
为了保留这些测试,一个有效替换:
9+
10+
- `is('DOM_SELECTOR')` 的方式是一个 `wrapper.wrappers.every(wrapper => wrapper.element.tagName === 'DOM_SELECTOR')` 的断言。
11+
- `is('ATTR_NAME')` 的方式是一个 `wrapper.wrappers.every(wrapper => wrapper.attributes('ATTR_NAME'))` 的 truthy 断言。
12+
- `is('CLASS_NAME')` 的方式是一个 `wrapper.wrappers.every(wrapper => wrapper.classes('CLASS_NAME'))` 的 truthy 断言。
13+
14+
当使用 `findComponent` 时,通过 `findComponent(Comp).element` 访问 DOM 元素。
15+
:::
16+
317
断言 `WrapperArray` 的每个 `Wrapper` 的 DOM 节点或 `vm` 匹配[选择器](../selectors.md)
418

519
- **参数:**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.