-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Utils): rename function from getDeepest to getDeepElement
- Loading branch information
1 parent
2d8d83b
commit 87379c9
Showing
8 changed files
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
tests/utils/get-deepest.test.ts → tests/utils/get-deep-element.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import { getDeepest, query } from '../../src/utils'; | ||
import { getDeepElement, query } from '../../src/utils'; | ||
|
||
describe('utils / get-deepest', () => { | ||
describe('utils / get-deep-element', () => { | ||
|
||
it('should return strong', () => { | ||
const element = query('<div><p><strong></strong></p></div>'); | ||
expect(getDeepest(element).name).to.equal('strong'); | ||
expect(getDeepElement(element).name).to.equal('strong'); | ||
}); | ||
|
||
it('should not return element', () => { | ||
const element = query('<div><p>foo</p></div>'); | ||
expect(getDeepest(element).name).to.equal(''); | ||
expect(getDeepElement(element).name).to.equal(''); | ||
}); | ||
|
||
it('should not return element when the deepest node is void', () => { | ||
const element = query('<div><p><br></p></div>'); | ||
expect(getDeepest(element).name).to.equal(''); | ||
expect(getDeepElement(element).name).to.equal(''); | ||
}); | ||
|
||
it('should return element when the deepest node is an empty text', () => { | ||
const element = query('<div><p><strong>\u200B</strong></p></div>'); | ||
expect(getDeepest(element).name).to.equal('strong'); | ||
expect(getDeepElement(element).name).to.equal('strong'); | ||
}); | ||
|
||
}); |