@@ -99,6 +99,33 @@ async def test_custom_component(client: AsyncClient, logged_in_headers, basic_co
99
99
assert "type" in result , "The dictionary must contain a key called 'type'"
100
100
101
101
102
+ async def test_custom_component_update (client : AsyncClient , logged_in_headers , basic_component ):
103
+ basic_case = basic_component .copy ()
104
+ basic_case |= {"field" : "string" , "field_value" : "string" , "template" : {}}
105
+ response = await client .post ("api/v1/custom_component/update" , json = basic_case , headers = logged_in_headers )
106
+ result = response .json ()
107
+
108
+ assert response .status_code == status .HTTP_200_OK
109
+ assert isinstance (result , dict ), "The result must be a dictionary"
110
+ assert "template" in result , "The dictionary must contain a key called 'template'"
111
+ assert "description" in result , "The dictionary must contain a key called 'description'"
112
+ assert "icon" in result , "The dictionary must contain a key called 'icon'"
113
+ assert "base_classes" in result , "The dictionary must contain a key called 'base_classes'"
114
+ assert "display_name" in result , "The dictionary must contain a key called 'display_name'"
115
+ assert "documentation" in result , "The dictionary must contain a key called 'documentation'"
116
+ assert "custom_fields" in result , "The dictionary must contain a key called 'custom_fields'"
117
+ assert "output_types" in result , "The dictionary must contain a key called 'output_types'"
118
+ assert "pinned" in result , "The dictionary must contain a key called 'pinned'"
119
+ assert "conditional_paths" in result , "The dictionary must contain a key called 'conditional_paths'"
120
+ assert "frozen" in result , "The dictionary must contain a key called 'frozen'"
121
+ assert "outputs" in result , "The dictionary must contain a key called 'outputs'"
122
+ assert "field_order" in result , "The dictionary must contain a key called 'field_order'"
123
+ assert "beta" in result , "The dictionary must contain a key called 'beta'"
124
+ assert "legacy" in result , "The dictionary must contain a key called 'legacy'"
125
+ assert "edited" in result , "The dictionary must contain a key called 'edited'"
126
+ assert "metadata" in result , "The dictionary must contain a key called 'metadata'"
127
+
128
+
102
129
async def test_get_config (client : AsyncClient ):
103
130
response = await client .get ("api/v1/config" )
104
131
result = response .json ()
0 commit comments