From 0809e4be0c34a334f223da05f908f4023d418217 Mon Sep 17 00:00:00 2001 From: Almas Date: Mon, 9 Aug 2021 01:07:43 +0800 Subject: [PATCH] test: trying to cover test scrollPositionOnCenter --- test/unit/specs/Props.spec.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/test/unit/specs/Props.spec.js b/test/unit/specs/Props.spec.js index 2587a16e..0aa81e99 100644 --- a/test/unit/specs/Props.spec.js +++ b/test/unit/specs/Props.spec.js @@ -1985,7 +1985,7 @@ describe('Props', () => { vm.openMenu() await vm.$nextTick() - sleep(50) + sleep(51) const menu = findMenu(wrapper) if (wrapper.contains('.vue-treeselect__option--selected') && menu.element.scrollHeight > menu.element.clientHeight) { expect(menu.element.scrollTop).toBeGreaterThan(0) @@ -1994,18 +1994,15 @@ describe('Props', () => { wrapper.setProps({ value: null, clearOnSelect: true }) vm.localSearch.active = true - sleep(50) + sleep(51) vm.select(vm.forest.nodeMap.abbb) + sleep(51) + vm.select(vm.forest.nodeMap.abbe) + sleep(51) vm.closeMenu() await vm.$nextTick() - sleep(100) - vm.openMenu() - await vm.$nextTick() - wrapper.setProps({ clearOnSelect: false }) - sleep(50) - vm.select(vm.forest.nodeMap.abbe) }) }) })