Files
ueblueprint/tests/nodeBitwiseAndInt64.spec.js
barsdeveloper 365732a99c WIP
2024-12-03 22:15:17 +02:00

42 lines
4.8 KiB
JavaScript
Executable File

import SVGIcon from "../js/SVGIcon.js"
import { expect, testNode } from "./fixtures/test.js"
testNode({
name: "Bitwise AND int64",
title: "&",
value: String.raw`
Begin Object Class=/Script/BlueprintGraph.K2Node_CommutativeAssociativeBinaryOperator Name="K2Node_CommutativeAssociativeBinaryOperator_8" ExportPath=/Script/BlueprintGraph.K2Node_CommutativeAssociativeBinaryOperator'"/Temp/Untitled_1.Untitled_1:PersistentLevel.Untitled.EventGraph.K2Node_CommutativeAssociativeBinaryOperator_8"'
bIsPureFunc=True
FunctionReference=(MemberParent=/Script/CoreUObject.Class'"/Script/Engine.KismetMathLibrary"',MemberName="And_Int64Int64")
NodePosX=128
NodePosY=-128
NodeGuid=48CCB97A110B4A6F8D54A95E138ABCE3
CustomProperties Pin (PinId=A9992AAF8CFA4349A77A5BAE866884D3,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinToolTip="Target\nKismet Math Library Object Reference",PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject=/Script/CoreUObject.Class'"/Script/Engine.KismetMathLibrary"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,DefaultObject="/Script/Engine.Default__KismetMathLibrary",PersistentGuid=00000000000000000000000000000000,bHidden=True,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
CustomProperties Pin (PinId=7433EDE1E9CE4293BC3C8D73BC9D9E65,PinName="A",PinToolTip="A\nInteger64",PinType.PinCategory="int64",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,DefaultValue="0",AutogeneratedDefaultValue="0",PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
CustomProperties Pin (PinId=C5CCE51FCE554859A66EDCA66875B382,PinName="B",PinToolTip="B\nInteger64",PinType.PinCategory="int64",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,DefaultValue="0",AutogeneratedDefaultValue="0",PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
CustomProperties Pin (PinId=A4753BC402474CDFB5A2513A2D7FC8A5,PinName="ReturnValue",PinToolTip="Return Value\nInteger64\n\nBitwise AND (A & B)",Direction="EGPD_Output",PinType.PinCategory="int64",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,DefaultValue="0",AutogeneratedDefaultValue="0",PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
End Object
`,
size: [9, 5],
pins: 3,
delegate: false,
development: false,
variadic: true,
additionalTest: async (node, pins, blueprintPage) => {
for (const pin of pins) {
expect(await pin.evaluate(pin => pin.template.renderIcon().strings.join("")))
.toStrictEqual(SVGIcon.operationPin.strings.join(""))
}
expect(await pins[0].evaluate(pin => pin.entity.DefaultValue.constructor.serialized)).toBeTruthy()
expect(await pins[1].evaluate(pin => pin.entity.DefaultValue.constructor.serialized)).toBeTruthy()
await pins[0].locator("ueb-input").fill("54")
await blueprintPage.blur()
expect(await pins[0].evaluate(pin => pin.entity.DefaultValue.constructor.serialized)).toBeTruthy()
expect(await pins[0].evaluate(pin => pin.entity.DefaultValue.serialize())).toEqual('"54"')
await pins[1].locator("ueb-input").fill("771")
await blueprintPage.blur()
expect(await pins[1].evaluate(pin => pin.entity.DefaultValue.constructor.serialized)).toBeTruthy()
expect(await pins[1].evaluate(pin => pin.entity.DefaultValue.serialize())).toEqual('"771"')
}
})