From ec48bb4c10f08e429091370163b2c7449339d741 Mon Sep 17 00:00:00 2001 From: Neyl Date: Mon, 20 Jan 2025 12:29:56 +0100 Subject: [PATCH] Update textinputruntimeobject.pixiruntimegamewithassets.spec.js --- ...meobject.pixiruntimegamewithassets.spec.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Extensions/TextInput/tests/textinputruntimeobject.pixiruntimegamewithassets.spec.js b/Extensions/TextInput/tests/textinputruntimeobject.pixiruntimegamewithassets.spec.js index 1aaffbbf43aa..0bc9b1d5c084 100644 --- a/Extensions/TextInput/tests/textinputruntimeobject.pixiruntimegamewithassets.spec.js +++ b/Extensions/TextInput/tests/textinputruntimeobject.pixiruntimegamewithassets.spec.js @@ -169,33 +169,33 @@ describe('gdjs.TextInputRuntimeObject (using a PixiJS RuntimeGame with DOM eleme object, } = await setupObjectAndGetDomElementContainer(); - const inputElement = gameDomElementContainer.querySelector('input'); - if (!inputElement) throw new Error('Expected input element to be found'); + const formElement = gameDomElementContainer.querySelector('form'); + if (!formElement) throw new Error('Expected form element to be found'); // Check visibility of the DOM element is visible by default, if it should be visible // on the screen. runtimeScene.renderAndStep(1000 / 60); - expect(inputElement.style.display).to.be('initial'); + expect(formElement.style.display).to.be('initial'); // Check visibility of the DOM element is updated at each frame, // according to the object visibility. object.hide(true); runtimeScene.renderAndStep(1000 / 60); - expect(inputElement.style.display).to.be('none'); + expect(formElement.style.display).to.be('none'); object.hide(false); runtimeScene.renderAndStep(1000 / 60); - expect(inputElement.style.display).to.be('initial'); + expect(formElement.style.display).to.be('initial'); // Check visibility of the DOM element is updated at each frame, // according to the layer visibility. runtimeScene.getLayer('').show(false); runtimeScene.renderAndStep(1000 / 60); - expect(inputElement.style.display).to.be('none'); + expect(formElement.style.display).to.be('none'); runtimeScene.getLayer('').show(true); runtimeScene.renderAndStep(1000 / 60); - expect(inputElement.style.display).to.be('initial'); + expect(formElement.style.display).to.be('initial'); // Clean up - not mandatory but to avoid overloading the testing browser. runtimeScene.unloadScene(); @@ -208,31 +208,31 @@ describe('gdjs.TextInputRuntimeObject (using a PixiJS RuntimeGame with DOM eleme object, } = await setupObjectAndGetDomElementContainer(); - const inputElement = gameDomElementContainer.querySelector('input'); - if (!inputElement) throw new Error('Expected input element to be found'); + const formElement = gameDomElementContainer.querySelector('form'); + if (!formElement) throw new Error('Expected input element to be found'); // Check visibility of the DOM element is visible by default, if it should be visible // on the screen. runtimeScene.renderAndStep(1000 / 60); - expect(inputElement.style.display).to.be('initial'); + expect(formElement.style.display).to.be('initial'); // Check visibility of the DOM element is updated at each frame, // according to the object position of screen. object.setX(-500); // -500 + 300 (object default width) = -200, still outside the camera. runtimeScene.renderAndStep(1000 / 60); - expect(inputElement.style.display).to.be('none'); + expect(formElement.style.display).to.be('none'); object.setWidth(600); // -500 + 600 = 100, inside the camera runtimeScene.renderAndStep(1000 / 60); - expect(inputElement.style.display).to.be('initial'); + expect(formElement.style.display).to.be('initial'); runtimeScene.getLayer('').setCameraX(900); runtimeScene.renderAndStep(1000 / 60); - expect(inputElement.style.display).to.be('none'); + expect(formElement.style.display).to.be('none'); runtimeScene.getLayer('').setCameraX(400); runtimeScene.renderAndStep(1000 / 60); - expect(inputElement.style.display).to.be('initial'); + expect(formElement.style.display).to.be('initial'); // Clean up - not mandatory but to avoid overloading the testing browser. runtimeScene.unloadScene();