mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-12 22:47:30 +08:00
Dropdown implementation, switch refactoring
* Various fixes * Fix tests * Dropdown names deduced from pin names * Remove update callbacks * Fix double pins issue * return undefined if not switch
This commit is contained in:
@@ -5,7 +5,7 @@ import Utility from "../../js/Utility.js"
|
||||
|
||||
/** @param {String[]} words */
|
||||
export function getFirstWordOrder(words) {
|
||||
return new RegExp("(?:.|\\n)*" + words.map(word => word + "(?:.|\\n)+").join("") + "(?:.|\\n)+")
|
||||
return new RegExp("\\s*" + words.join("[^\\n]+\\n\\s*") + "\\s*")
|
||||
}
|
||||
|
||||
/** @param {() => Blueprint} getBlueprint */
|
||||
@@ -59,7 +59,7 @@ export function generateNodeTest(nodeTest, getBlueprint) {
|
||||
getBlueprint().selectAll()
|
||||
const value = getBlueprint().template.getCopyInputObject().getSerializedText()
|
||||
const words = value.split("\n").map(row => row.match(/\s*(\w+(\s+\w+)*).+/)?.[1]).filter(v => v?.length > 0)
|
||||
return expect(value).to.match(getFirstWordOrder(words))
|
||||
expect(value).to.match(getFirstWordOrder(words))
|
||||
})
|
||||
if (nodeTest.additionalTest) {
|
||||
it("Additional tests", () => {
|
||||
|
||||
Reference in New Issue
Block a user