Skip to content

Commit 386bc4c

Browse files
author
Hesam Bahrami
authored
refactor: remove unnecessary asynchronicity from the addPlaceholderList method (#38)
1 parent 397ee15 commit 386bc4c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,9 @@ class NestedSort {
359359
this.placeholderInUse.style.minHeight = `${this.draggedNode.offsetHeight}px`
360360
}
361361

362-
async addPlaceholderList() {
362+
addPlaceholderList() {
363363
this.getPlaceholderList()
364-
await this.targetedNode.appendChild(this.placeholderInUse)
364+
this.targetedNode.appendChild(this.placeholderInUse)
365365
this.animatePlaceholderList()
366366
}
367367

test/main.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,13 +884,13 @@ describe('NestedSort', () => {
884884
})
885885

886886
describe('addPlaceholderList method', () => {
887-
it('should append the placeholderInUse property to the targetedNode and call the animatePlaceholderList method', async () => {
887+
it('should append the placeholderInUse property to the targetedNode and call the animatePlaceholderList method', () => {
888888
const ns = initDataDrivenList()
889889
ns.targetedNode = document.querySelector('li[data-id="1"]')
890890
ns.targetedNode.appendChild = jest.fn()
891891
ns.animatePlaceholderList = jest.fn()
892892

893-
await ns.addPlaceholderList()
893+
ns.addPlaceholderList()
894894

895895
expect(ns.targetedNode.appendChild).toHaveBeenCalledTimes(1)
896896
expect(ns.targetedNode.appendChild).toHaveBeenCalledWith(ns.placeholderInUse)

0 commit comments

Comments
 (0)