This repository has been archived by the owner on Dec 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add saveTabbable - update interfaces - update current UT's - add docs
- Loading branch information
1 parent
482caad
commit c5a8732
Showing
21 changed files
with
500 additions
and
173 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
9 changes: 0 additions & 9 deletions
9
lib/clientSideScripts/__snapshots__/removeCustomCss.spec.ts.snap
This file was deleted.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
lib/clientSideScripts/__snapshots__/removeElementFromDom.spec.ts.snap
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`removeElementFromDom should be able to remove an element from the body 1`] = ` | ||
<body> | ||
<div> | ||
<span | ||
id="id-1" | ||
> | ||
Hello | ||
</span> | ||
<span | ||
id="id-2" | ||
> | ||
Hello | ||
</span> | ||
<div> | ||
<span | ||
id="id-3" | ||
> | ||
Hello | ||
</span> | ||
<span | ||
id="id-4" | ||
> | ||
Hello | ||
</span> | ||
</div> | ||
</div> | ||
</body> | ||
`; | ||
|
||
exports[`removeElementFromDom should be able to remove an element from the body 2`] = ` | ||
<body> | ||
<div> | ||
<span | ||
id="id-2" | ||
> | ||
Hello | ||
</span> | ||
<div> | ||
<span | ||
id="id-3" | ||
> | ||
Hello | ||
</span> | ||
<span | ||
id="id-4" | ||
> | ||
Hello | ||
</span> | ||
</div> | ||
</div> | ||
</body> | ||
`; | ||
|
||
exports[`removeElementFromDom should be able to remove the custom css 1`] = `"body:{width:100%}"`; | ||
|
||
exports[`removeElementFromDom should be able to remove the custom css 2`] = `""`; | ||
|
||
exports[`removeElementFromDom should do nothing if custom css is not present 1`] = `""`; | ||
|
||
exports[`removeElementFromDom should do nothing if custom css is not present 2`] = `""`; |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface ElementCoordinate { | ||
x: number; | ||
y: number; | ||
} |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* Remove a DOM element from the DOM | ||
*/ | ||
export default function removeElementFromDom(id: string): void { | ||
const elem = document.querySelector(`#${id}`); | ||
if (elem != null) { | ||
elem.parentNode.removeChild(elem); | ||
} | ||
} |
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
Oops, something went wrong.