Skip to content

Commit c994146

Browse files
committed
increase transition test duration buffer on saucelabs
1 parent 06f41ad commit c994146

File tree

6 files changed

+62
-60
lines changed

6 files changed

+62
-60
lines changed

build/karma.base.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ var webpackConfig = {
1818
new webpack.DefinePlugin({
1919
'process.env': {
2020
NODE_ENV: '"development"',
21-
TRANSITION_DURATION: process.env.SAUCE ? 200 : 50
21+
TRANSITION_DURATION: process.env.SAUCE ? 200 : 50,
22+
TRANSITION_BUFFER: process.env.SAUCE ? 30 : 10
2223
}
2324
})
2425
],

test/unit/features/component/component-keep-alive.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { isIE9 } from 'core/util/env'
44
import { nextFrame } from 'web/runtime/transition-util'
55

66
describe('Component keep-alive', () => {
7-
const duration = injectStyles()
7+
const { duration, buffer } = injectStyles()
88
let components, one, two, el
99
beforeEach(() => {
1010
one = {
@@ -186,7 +186,7 @@ describe('Component keep-alive', () => {
186186
expect(vm.$el.innerHTML).toBe(
187187
'<div class="test test-enter-active">two</div>'
188188
)
189-
}).thenWaitFor(duration + 10).then(() => {
189+
}).thenWaitFor(duration + buffer).then(() => {
190190
expect(vm.$el.innerHTML).toBe(
191191
'<div class="test">two</div>'
192192
)
@@ -216,7 +216,7 @@ describe('Component keep-alive', () => {
216216
expect(vm.$el.innerHTML).toBe(
217217
'<div class="test test-enter-active">one</div>'
218218
)
219-
}).thenWaitFor(duration + 10).then(() => {
219+
}).thenWaitFor(duration + buffer).then(() => {
220220
expect(vm.$el.innerHTML).toBe(
221221
'<div class="test">one</div>'
222222
)
@@ -276,7 +276,7 @@ describe('Component keep-alive', () => {
276276
'<div class="test test-leave-active">one</div>' +
277277
'<div class="test">two</div>'
278278
)
279-
}).thenWaitFor(duration + 10).then(() => {
279+
}).thenWaitFor(duration + buffer).then(() => {
280280
expect(vm.$el.innerHTML).toBe(
281281
'<div class="test">two</div>'
282282
)
@@ -311,7 +311,7 @@ describe('Component keep-alive', () => {
311311
'<div class="test test-leave-active">two</div>' +
312312
'<div class="test">one</div>'
313313
)
314-
}).thenWaitFor(duration + 10).then(() => {
314+
}).thenWaitFor(duration + buffer).then(() => {
315315
expect(vm.$el.innerHTML).toBe(
316316
'<div class="test">one</div>'
317317
)
@@ -381,7 +381,7 @@ describe('Component keep-alive', () => {
381381
'<div class="test test-leave-active">two</div>' +
382382
'<div class="test">one</div>'
383383
)
384-
}).thenWaitFor(duration + 10).then(() => {
384+
}).thenWaitFor(duration + buffer).then(() => {
385385
expect(vm.$el.innerHTML).toBe(
386386
'<div class="test">one</div>'
387387
)

test/unit/features/transition/inject-styles.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ function insertCSS (text) {
55
}
66

77
const duration = process.env.TRANSITION_DURATION || 50
8+
const buffer = process.env.TRANSITION_BUFFER || 10
89
let injected = false
910

1011
export default function injectStyles () {
11-
if (injected) return duration
12+
if (injected) return { duration, buffer }
1213
injected = true
1314
insertCSS(`
1415
.test {
@@ -58,6 +59,6 @@ export default function injectStyles () {
5859
to { opacity: 0 }
5960
}
6061
`)
61-
return duration
62+
return { duration, buffer }
6263
}
6364

test/unit/features/transition/transition-group.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { nextFrame } from 'web/runtime/transition-util'
55

66
if (!isIE9) {
77
describe('Transition group', () => {
8-
const duration = injectStyles()
8+
const { duration, buffer } = injectStyles()
99

1010
let el
1111
beforeEach(() => {
@@ -55,7 +55,7 @@ if (!isIE9) {
5555
`<div class="test v-enter-active">e</div>` +
5656
`</span>`
5757
)
58-
}).thenWaitFor(duration + 10).then(() => {
58+
}).thenWaitFor(duration + buffer).then(() => {
5959
expect(vm.$el.innerHTML).toBe(
6060
`<span>` +
6161
vm.items.map(i => `<div class="test">${i}</div>`).join('') +
@@ -83,7 +83,7 @@ if (!isIE9) {
8383
`<div class="test v-leave-active">c</div>` +
8484
`</span>`
8585
)
86-
}).thenWaitFor(duration + 10).then(() => {
86+
}).thenWaitFor(duration + buffer).then(() => {
8787
expect(vm.$el.innerHTML).toBe(
8888
`<span>` +
8989
vm.items.map(i => `<div class="test">${i}</div>`).join('') +
@@ -113,7 +113,7 @@ if (!isIE9) {
113113
`<div class="test v-enter-active">d</div>` +
114114
`</span>`
115115
)
116-
}).thenWaitFor(duration + 10).then(() => {
116+
}).thenWaitFor(duration + buffer).then(() => {
117117
expect(vm.$el.innerHTML).toBe(
118118
`<span>` +
119119
vm.items.map(i => `<div class="test">${i}</div>`).join('') +
@@ -143,7 +143,7 @@ if (!isIE9) {
143143
`<div class="test v-enter-active">d</div>` +
144144
`</span>`
145145
)
146-
}).thenWaitFor(duration + 10).then(() => {
146+
}).thenWaitFor(duration + buffer).then(() => {
147147
expect(vm.$el.innerHTML).toBe(
148148
`<span>` +
149149
vm.items.map(i => `<div class="test">${i}</div>`).join('') +
@@ -166,7 +166,7 @@ if (!isIE9) {
166166
vm.items.map(i => `<div class="test v-enter-active">${i}</div>`).join('') +
167167
`</span>`
168168
)
169-
}).thenWaitFor(duration + 10).then(() => {
169+
}).thenWaitFor(duration + buffer).then(() => {
170170
expect(vm.$el.innerHTML).toBe(
171171
`<span>` +
172172
vm.items.map(i => `<div class="test">${i}</div>`).join('') +

test/unit/features/transition/transition-mode.spec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { nextFrame } from 'web/runtime/transition-util'
55

66
if (!isIE9) {
77
describe('Transition mode', () => {
8-
const duration = injectStyles()
8+
const { duration, buffer } = injectStyles()
99
const components = {
1010
one: { template: '<div>one</div>' },
1111
two: { template: '<div>two</div>' }
@@ -40,7 +40,7 @@ if (!isIE9) {
4040
'<div class="test v-leave-active">one</div>' +
4141
'<div class="test v-enter-active">two</div>'
4242
)
43-
}).thenWaitFor(duration + 10).then(() => {
43+
}).thenWaitFor(duration + buffer).then(() => {
4444
expect(vm.$el.innerHTML).toBe(
4545
'<div class="test">two</div>'
4646
)
@@ -84,7 +84,7 @@ if (!isIE9) {
8484
expect(vm.$el.innerHTML).toBe(
8585
'<div class="test test-enter-active">two</div>'
8686
)
87-
}).thenWaitFor(duration + 10).then(() => {
87+
}).thenWaitFor(duration + buffer).then(() => {
8888
expect(vm.$el.innerHTML).toBe(
8989
'<div class="test">two</div>'
9090
)
@@ -132,7 +132,7 @@ if (!isIE9) {
132132
expect(vm.$el.innerHTML).toBe(
133133
'<div class="test test-enter-active">two</div>'
134134
)
135-
}).thenWaitFor(duration + 10).then(() => {
135+
}).thenWaitFor(duration + buffer).then(() => {
136136
expect(vm.$el.innerHTML).toBe(
137137
'<div class="test">two</div>'
138138
)
@@ -183,7 +183,7 @@ if (!isIE9) {
183183
'<div class="test test-leave-active">one</div>' +
184184
'<div class="test">two</div>'
185185
)
186-
}).thenWaitFor(duration + 10).then(() => {
186+
}).thenWaitFor(duration + buffer).then(() => {
187187
expect(vm.$el.innerHTML).toBe(
188188
'<div class="test">two</div>'
189189
)
@@ -249,7 +249,7 @@ if (!isIE9) {
249249
'<div class="test test-leave-active">two</div>' +
250250
'<div class="test">one</div>'
251251
)
252-
}).thenWaitFor(duration + 10).then(() => {
252+
}).thenWaitFor(duration + buffer).then(() => {
253253
expect(vm.$el.innerHTML).toBe(
254254
'<div class="test">one</div>'
255255
)
@@ -278,7 +278,7 @@ if (!isIE9) {
278278
'<div class="test v-leave-active">one</div>' +
279279
'<div class="test v-enter-active">two</div>'
280280
)
281-
}).thenWaitFor(duration + 10).then(() => {
281+
}).thenWaitFor(duration + buffer).then(() => {
282282
expect(vm.$el.innerHTML).toBe(
283283
'<div class="test">two</div>'
284284
)
@@ -321,7 +321,7 @@ if (!isIE9) {
321321
expect(vm.$el.innerHTML).toBe(
322322
'<div class="test test-enter-active">two</div>'
323323
)
324-
}).thenWaitFor(duration + 10).then(() => {
324+
}).thenWaitFor(duration + buffer).then(() => {
325325
expect(vm.$el.innerHTML).toBe(
326326
'<div class="test">two</div>'
327327
)
@@ -371,7 +371,7 @@ if (!isIE9) {
371371
'<div class="test test-leave-active">one</div>' +
372372
'<div class="test">two</div>'
373373
)
374-
}).thenWaitFor(duration + 10).then(() => {
374+
}).thenWaitFor(duration + buffer).then(() => {
375375
expect(vm.$el.innerHTML).toBe(
376376
'<div class="test">two</div>'
377377
)

0 commit comments

Comments
 (0)