mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:41:34 +08:00
56 lines
4.2 KiB
JavaScript
56 lines
4.2 KiB
JavaScript
/// <reference types="cypress" />
|
|
|
|
import Blueprint from "../../../js/Blueprint"
|
|
import Configuration from "../../../js/Configuration"
|
|
import getFirstWordOrder from "../../fixtures/getFirstWordOrder"
|
|
import NodeElement from "../../../js/element/NodeElement"
|
|
import SVGIcon from "../../../js/SVGIcon"
|
|
import Utility from "../../../js/Utility"
|
|
|
|
describe("4", () => {
|
|
|
|
context("Tests", () => {
|
|
/** @type {NodeElement} */
|
|
let node
|
|
/** @type {Blueprint} */
|
|
let blueprint
|
|
|
|
before(() => {
|
|
cy.visit(`http://127.0.0.1:${Cypress.env("UEBLUEPRINT_TEST_SERVER_PORT")}/empty.html`)
|
|
cy.get("ueb-blueprint")
|
|
.then(b => blueprint = b[0])
|
|
.click(100, 300)
|
|
.then(() => Utility.paste(blueprint, String.raw`
|
|
Begin Object Class=/Script/BlueprintGraph.K2Node_InputKey Name="K2Node_InputKey_4"
|
|
InputKey=Four
|
|
NodePosX=416
|
|
NodeGuid=C0E7B79B3B85408C9FFAFE71B71FD21F
|
|
CustomProperties Pin (PinId=28E3A745210949D0864CC441BB0F529C,PinName="Pressed",Direction="EGPD_Output",PinType.PinCategory="exec",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,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
|
|
CustomProperties Pin (PinId=F8A89129B85C44CABFC5082369EEDA65,PinName="Released",Direction="EGPD_Output",PinType.PinCategory="exec",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,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
|
|
CustomProperties Pin (PinId=00DE1A9A2AE249E681808177A2107D5A,PinName="Key",Direction="EGPD_Output",PinType.PinCategory="struct",PinType.PinSubCategory="",PinType.PinSubCategoryObject=/Script/CoreUObject.ScriptStruct'"/Script/InputCore.Key"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,DefaultValue="None",AutogeneratedDefaultValue="None",PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
|
|
End Object
|
|
`))
|
|
.then(() => node = blueprint.querySelector("ueb-node"))
|
|
})
|
|
it("is red", () => expect(Configuration.nodeColor(node)).to.be.equal(Configuration.nodeColors.red))
|
|
it("has no delegate", () => expect(node.querySelector('.ueb-node-top ueb-pin[data-type="delegate"]')).to.be.null)
|
|
it("is called 4", () => expect(node.getNodeDisplayName()).to.be.equal("4"))
|
|
it("has a keyboard icon", () => expect(Configuration.nodeIcon(node)).to.be.equal(SVGIcon.keyboard))
|
|
it("has 3 pins", () => expect(node.querySelectorAll("ueb-pin")).to.be.lengthOf(3))
|
|
it("is not development only", () => expect(node.entity.isDevelopmentOnly()).to.be.false)
|
|
it("maintains the order of attributes", () => {
|
|
blueprint.selectAll()
|
|
const value = blueprint.template.getCopyInputObject().getSerializedText()
|
|
expect(value).to.match(getFirstWordOrder([
|
|
"InputKey",
|
|
"NodePosX",
|
|
"NodePosY",
|
|
"NodeGuid",
|
|
"CustomProperties",
|
|
"CustomProperties",
|
|
"CustomProperties",
|
|
]))
|
|
})
|
|
})
|
|
})
|