统一组件图标布局并完善选择吸附交互
This commit is contained in:
1 parent
40c72422ff
commit
7671418582
16 files changed
+4359
-598
No files matched your search
@@ -66,5 +66,39 @@ class ReactFlowProjectMediumReferenceVersionTests(unittest.TestCase):
|
||||
self.assertIn('<Parameter name="property_model" value="0.0"', xml)
|
||||
|
||||
|
||||
class ReactFlowPresentationLayoutVersionTests(unittest.TestCase):
|
||||
def test_layout_version_is_preserved_but_not_written_to_xml(self) -> None:
|
||||
project = ReactFlowProjectPayload(
|
||||
name="versioned-presentation-layout",
|
||||
presentationLayoutVersion=1,
|
||||
)
|
||||
|
||||
self.assertEqual(project.presentationLayoutVersion, 1)
|
||||
self.assertEqual(
|
||||
pydantic_to_jsonable(project)["presentationLayoutVersion"],
|
||||
1,
|
||||
)
|
||||
xml = build_reactflow_system_xml(project).decode("utf-8")
|
||||
self.assertNotIn("presentationLayoutVersion", xml)
|
||||
|
||||
def test_layout_version_rejects_unsupported_values(self) -> None:
|
||||
for version in (0, 2, -1, "1"):
|
||||
with self.subTest(version=version):
|
||||
with self.assertRaises(ValueError):
|
||||
ReactFlowProjectPayload(
|
||||
name="unsupported-presentation-layout",
|
||||
presentationLayoutVersion=version,
|
||||
)
|
||||
|
||||
def test_legacy_layout_version_remains_missing(self) -> None:
|
||||
project = ReactFlowProjectPayload(name="legacy-presentation-layout")
|
||||
|
||||
self.assertIsNone(project.presentationLayoutVersion)
|
||||
self.assertNotIn(
|
||||
"presentationLayoutVersion",
|
||||
pydantic_to_jsonable(project),
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user