This commit is contained in:
2026-08-12 06:16:00 +08:00
parent 9192b5953c
commit b51833499f
6 changed files with 386 additions and 146 deletions
+22
View File
@@ -1,5 +1,6 @@
#include "../app/Gallery_Plot_Session.h"
#include "../app/Gallery_Protocol.h"
#include "../app/Gallery_Renderables.h"
#include "../app/Pixel_Frame.h"
#include "../app/Web_Event_Adapter.h"
#include "../app/Web_Plot_Session.h"
@@ -267,6 +268,27 @@ TEST(RenderiveWebGallery, CatalogOwnsDashboardFieldsAndDynamicBehavior) {
EXPECT_TRUE(action->at("request_frame"));
}
TEST(RenderiveWebGallery, ActionsComeFromStructiveTypeMetadata) {
using Spectrum_Schema = structive::type_descriptor_schema_t<Gallery_Spectrum>;
using Time_Axis_Schema = structive::type_descriptor_schema_t<Gallery_Time_Axis>;
using Manual_Strategy =
Manual_Refresh_Strategy<Scene2D_Frame_Data, std::mutex, Observer_State<>>;
using Manual_Schema = structive::type_descriptor_schema_t<Manual_Strategy>;
static_assert(Spectrum_Schema::template type_attribute_count<
Gallery_Action_Category> == 12);
static_assert(Time_Axis_Schema::template type_attribute_count<
Gallery_Action_Category> == 2);
static_assert(Manual_Schema::template type_attribute_count<
Gallery_Action_Category> == 5);
std::vector<Gallery_Action_Model> actions;
append_gallery_actions<Gallery_Spectrum>(actions);
EXPECT_EQ(actions.size(), 12U);
EXPECT_TRUE(std::any_of(actions.begin(), actions.end(), [](const auto& action) {
return action.id == "power_at" && action.argument_input == "number";
}));
}
TEST(RenderiveWebBridge, ComposesAdditionalEventDecoders) {
const auto event = Extended_Web_Event_Adapter::decode(
R"({"category":"event","type":"spatial_test","layer":7})");