Header removals wait for the code editor to be left: autosave saves with drop=false, so follow_header adds and renames from the header but keeps a port or setting whose parameter is gone, and leaving the editor (blur or closing the panel) saves once more with removals; source saves of a flow run one at a time
This commit is contained in:
@@ -580,6 +580,13 @@ def test_saving_a_header_moves_the_node_ports_in_the_draft(
|
||||
assert response["version"] == saved["definition"]["version"] + 1
|
||||
logger = next(n for n in draft["definition"]["nodes"] if n["id"] == "logger")
|
||||
assert logger["params"] == {"gain": 2}
|
||||
# The editor's autosave: a parameter typed away keeps its port for now.
|
||||
paused = client.put(
|
||||
f"{PREFIX}/header/nodes/logger/source?drop=false",
|
||||
headers=superuser_token_headers,
|
||||
json={"code": "def process(reading, gain=2):\n return {}\n"},
|
||||
).json()
|
||||
assert paused["node"] is None
|
||||
|
||||
client.delete(f"{PREFIX}/header", headers=superuser_token_headers)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user