mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Merge pull request #1847 from PR0M3TH3AN/fix-upload-modal-test-15043512839358145269
Fix UploadModal DOM initialization for robust testing
This commit is contained in:
1 file changed
+5
-5
@@ -160,11 +160,11 @@ export class UploadModal {
|
||||
wrapper.innerHTML = html;
|
||||
this.removeTrackingScripts(wrapper);
|
||||
|
||||
targetContainer.appendChild(wrapper.firstElementChild);
|
||||
this.root = targetContainer.querySelector("#uploadModal");
|
||||
if (!this.root && targetContainer.lastElementChild && targetContainer.lastElementChild.id === "uploadModal") {
|
||||
this.root = targetContainer.lastElementChild;
|
||||
}
|
||||
const modalRoot = wrapper.querySelector("#uploadModal");
|
||||
if (!modalRoot) throw new Error("UploadModal template must contain #uploadModal element");
|
||||
|
||||
targetContainer.appendChild(modalRoot);
|
||||
this.root = modalRoot;
|
||||
this.container = targetContainer;
|
||||
|
||||
this.cacheElements();
|
||||
|
||||
Reference in new issue
Block a user