更完
This commit is contained in:
@@ -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})");
|
||||
|
||||
Reference in New Issue
Block a user