Skip to content

Commit

Permalink
Add Test Parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
kd9lsv authored Jan 10, 2025
1 parent 741dd3d commit 9dccb29
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/flows/basic-layout-after.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,39 @@
[]
]
},
{
"id": "940a12ce19bf2212",
"type": "ui-number-input",
"z": "94d6d107f1742efb",
"name": "",
"label": "numeric",
"tooltip": "",
"group": "f663864dda246564",
"order": 13,
"width": 0,
"height": 0,
"passthru": true,
"topic": "topic",
"topicType": "msg",
"min": 0,
"max": 10,
"step": 1,
"className": "",
"x": 320,
"y": 440,
"wires": [
[

]
],
"sendOnBlue": true,
"sendOnEnter": true,
"clearable": false,
"icon": "",
"iconPosition": "left",
"iconInnerPosition": "inside",
"spinner": "default"
},
{
"id": "856a31bba370e7fc",
"type": "ui-group",
Expand Down
26 changes: 26 additions & 0 deletions tests/flows/basic-layout-before.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,32 @@
[]
]
},
{
"id": "b52c292d531874a6",
"type": "ui_numeric",
"z": "94d6d107f1742efb",
"name": "",
"label": "numeric",
"tooltip": "",
"group": "856a31bba370e7fc",
"order": 13,
"width": 0,
"height": 0,
"wrap": false,
"passthru": true,
"topic": "topic",
"topicType": "msg",
"format": "$ {{value}} ",
"min": 0,
"max": 10,
"step": 1,
"className": "",
"x": 320,
"y": 440,
"wires": [
[]
]
},
{
"id": "856a31bba370e7fc",
"type": "ui_group",
Expand Down
14 changes: 14 additions & 0 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,20 @@ describe('Dashboard Migration Script', function () {
})
})

describe('UI Number Input', function () {
const input = utils.getByType(migratedFlow, 'ui-number-input')[0]
const input1 = utils.getByType(basicLayoutAfter, 'ui-number-input')[0]

const excludeFromChecks = ['id', 'group']
Object.keys(input).forEach((prop) => {
if (!excludeFromChecks.includes(prop)) {
it('should set ' + prop + ' correctly ', function () {
input[prop].should.eql(input1[prop])
})
}
})
})

describe('Unsupported UI Nodes:', function () {
it('should should be disabled in the NR Editor', function () {
const template0 = utils.getByType(migratedFlow, 'ui_template')[0]
Expand Down

0 comments on commit 9dccb29

Please sign in to comment.