mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
57 lines
4.3 KiB
JavaScript
57 lines
4.3 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("9", () => {
|
|
|
|
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_9"
|
|
InputKey=Nine
|
|
NodePosX=320
|
|
NodePosY=-96
|
|
NodeGuid=5734865695E74306BFBF523823756FBF
|
|
CustomProperties Pin (PinId=98970DC76172490A9ED3B7189F76403D,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=48EF1C8294D74BA48A23336ED6C2F3A5,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=5A660296AF3F4F10B7175D9BB3819100,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 9", () => expect(node.getNodeDisplayName()).to.be.equal("9"))
|
|
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",
|
|
]))
|
|
})
|
|
})
|
|
})
|