Adding a widget ref appears in the workspace's widgets list.
(api_client, clean_state)
| 279 | |
| 280 | @pytest.mark.project |
| 281 | def test_widget_add_and_get(api_client, clean_state): |
| 282 | """Adding a widget ref appears in the workspace's widgets list.""" |
| 283 | # GroupWidget::DataGrid (0) renders DashboardWidget::DashboardDataGrid (1): |
| 284 | # the compatible pair. Accelerometer/Gyro/GPS are fixed-layout groups that |
| 285 | # reject user-added datasets, so dataset_count would silently spawn a stray |
| 286 | # default group instead of populating this one. |
| 287 | gid = _add_group_with_datasets(api_client, "G", widget_type=0, dataset_count=3) |
| 288 | wid = _add_workspace(api_client, "W")["id"] |
| 289 | time.sleep(0.15) |
| 290 | |
| 291 | _widget_add(api_client, wid, widget_type=1, group_id=gid, relative_index=0) |
| 292 | time.sleep(0.15) |
| 293 | |
| 294 | widgets = _get_workspace(api_client, wid)["widgets"] |
| 295 | assert len(widgets) == 1 |
| 296 | assert widgets[0]["widgetType"] == 1 |
| 297 | assert widgets[0]["groupId"] == gid |
| 298 | assert widgets[0]["relativeIndex"] == 0 |
| 299 | |
| 300 | |
| 301 | @pytest.mark.project |
nothing calls this directly
no test coverage detected