Skip to content

Commit d51223e

Browse files
authored
Merge branch 'dev' into patch-2
2 parents 4b0dc5e + d5a4ac2 commit d51223e

17 files changed

+14241
-41
lines changed

docs/.vuepress/config.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ module.exports = {
5959
link: '/guides/',
6060
items: [
6161
{
62-
text: '2.x-beta',
63-
link: 'https://next.vue-test-utils.vuejs.org/guide/'
62+
text: 'v2 (Vue.js 3)',
63+
link: 'https://test-utils.vuejs.org/'
6464
}
6565
]
6666
},
@@ -94,8 +94,8 @@ module.exports = {
9494
link: '/zh/guides/',
9595
items: [
9696
{
97-
text: '2.x-beta',
98-
link: 'https://next.vue-test-utils.vuejs.org/guide/'
97+
text: 'v2 (Vue.js 3)',
98+
link: 'https://test-utils.vuejs.org/'
9999
}
100100
]
101101
}
@@ -125,8 +125,8 @@ module.exports = {
125125
link: '/ja/guides/',
126126
items: [
127127
{
128-
text: '2.x-beta',
129-
link: 'https://next.vue-test-utils.vuejs.org/guide/'
128+
text: 'v2 (Vue.js 3)',
129+
link: 'https://test-utils.vuejs.org/'
130130
}
131131
]
132132
}
@@ -156,8 +156,8 @@ module.exports = {
156156
link: '/ru/guides/',
157157
items: [
158158
{
159-
text: '2.x-beta',
160-
link: 'https://next.vue-test-utils.vuejs.org/guide/'
159+
text: 'v2 (Vue.js 3)',
160+
link: 'https://test-utils.vuejs.org/'
161161
}
162162
]
163163
}
@@ -187,9 +187,8 @@ module.exports = {
187187
link: '/fr/guides/',
188188
items: [
189189
{
190-
text: '2.x-beta',
191-
link:
192-
'https://vuejs.github.io/vue-test-utils-next-docs/guide/introduction.html'
190+
text: 'v2 (Vue.js 3)',
191+
link: 'https://test-utils.vuejs.org/'
193192
}
194193
]
195194
}

docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is the documentation for Vue Test Utils v1, which targets Vue 2 and earlier
77
In short:
88

99
- [Vue Test Utils 1](https://github.com/vuejs/vue-test-utils/) targets [Vue 2](https://github.com/vuejs/vue/).
10-
- [Vue Test Utils 2](https://github.com/vuejs/vue-test-utils-next/) targets [Vue 3](https://github.com/vuejs/vue-next/).
10+
- [Vue Test Utils 2](https://github.com/vuejs/test-utils) targets [Vue 3](https://github.com/vuejs/core).
1111

1212
<div class="vueschool"><a href="https://vueschool.io/courses/learn-how-to-test-vuejs-components?friend=vuejs" target="_blank" rel="sponsored noopener" title="Learn how to use Vue Test Utils to test Vue.js Components with Vue School">Learn how to test Vue.js components with Vue School</a></div>
1313

docs/api/wrapper/findAllComponents.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ expect(bars).toHaveLength(1)
2323
```
2424

2525
::: warning Usage with CSS selectors
26-
Using `findAllComponents` with CSS selector is subject to same limitations as [findComponent](api/wrapper/findComponent.md)
26+
Using `findAllComponents` with CSS selector is subject to same limitations as [findComponent](./findComponent.md)
2727
:::

docs/fr/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Voici la documentation de Vue Test Utils v1, qui vise Vue 2 et les versions ant
77
En bref :
88

99
- [Vue Test Utils 1](https://github.com/vuejs/vue-test-utils/) ciblant [Vue 2](https://github.com/vuejs/vue/).
10-
- [Vue Test Utils 2](https://github.com/vuejs/vue-test-utils-next/) ciblant [Vue 3](https://github.com/vuejs/vue-next/).
10+
- [Vue Test Utils 2](https://github.com/vuejs/test-utils) ciblant [Vue 3](https://github.com/vuejs/core).
1111

1212
<div class="vueschool"><a href="https://vueschool.io/courses/learn-how-to-test-vuejs-components?friend=vuejs" target="_blank" rel="sponsored noopener" title="Learn how to use Vue Test Utils to test Vue.js Components with Vue School">Apprenez comment tester les composants de Vue.js avec Vue School</a></div>
1313

docs/zh/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 介绍
22

33
::: warning
4-
本文档基于 Vue2.x,新版本文档请移步至[这里](https://next.vue-test-utils.vuejs.org/guide/)
4+
本文档基于 Vue2.x,新版本文档请移步至[这里](https://test-utils.vuejs.org/)
55
:::
66

77
Vue Test Utils 是 Vue.js 官方的单元测试实用工具库。

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
],
66
"npmClient": "yarn",
77
"useWorkspaces": true,
8-
"version": "1.3.0"
8+
"version": "1.3.3"
99
}

packages/server-test-utils/dist/vue-server-test-utils.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -8084,7 +8084,15 @@ ErrorWrapper.prototype.destroy = function destroy () {
80848084
*/
80858085

80868086
function isStyleVisible(element) {
8087-
var ref = element.style;
8087+
if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) {
8088+
return false
8089+
}
8090+
8091+
// Per https://lists.w3.org/Archives/Public/www-style/2018May/0031.html
8092+
// getComputedStyle should only work with connected elements.
8093+
var ref = element.isConnected
8094+
? getComputedStyle(element)
8095+
: element.style;
80888096
var display = ref.display;
80898097
var visibility = ref.visibility;
80908098
var opacity = ref.opacity;

packages/server-test-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/server-test-utils",
3-
"version": "1.3.0",
3+
"version": "1.3.3",
44
"description": "Utilities for testing Vue components.",
55
"main": "dist/vue-server-test-utils.js",
66
"types": "types/index.d.ts",

packages/shared/is-visible.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@
55
*/
66

77
function isStyleVisible(element) {
8-
const { display, visibility, opacity } = element.style
8+
if (
9+
!(element instanceof window.HTMLElement) &&
10+
!(element instanceof window.SVGElement)
11+
) {
12+
return false
13+
}
14+
15+
// Per https://lists.w3.org/Archives/Public/www-style/2018May/0031.html
16+
// getComputedStyle should only work with connected elements.
17+
const { display, visibility, opacity } = element.isConnected
18+
? getComputedStyle(element)
19+
: element.style
920
return (
1021
display !== 'none' &&
1122
visibility !== 'hidden' &&

0 commit comments

Comments
 (0)