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:
barsdeveloper
2023-04-22 12:44:37 +02:00
committed by GitHub
parent e06589bc46
commit 8a96af670e
32 changed files with 1024 additions and 365 deletions

View File

@@ -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", () => {