Add real-time layout sync and refresh default layout
This commit is contained in:
1 parent
274b8538b7
commit
f79e30897b
20 files changed
+289
-77
No files matched your search
@@ -34,6 +34,17 @@ class LayoutApiTest {
|
||||
|
||||
@TempDir Path dir;
|
||||
|
||||
@Test
|
||||
void layoutEventStreamRequiresDeviceToken() throws Exception {
|
||||
MockMvc mvc = mvc(dir.resolve("events.sqlite"));
|
||||
mvc.perform(get("/api/layout/events")).andExpect(status().isUnauthorized());
|
||||
mvc.perform(get("/api/layout/events").header("Authorization", ADMIN)).andExpect(status().isUnauthorized());
|
||||
mvc.perform(get("/api/layout/events").header("Authorization", DEVICE))
|
||||
.andExpect(org.springframework.test.web.servlet.result.MockMvcResultMatchers.request().asyncStarted())
|
||||
.andExpect(header().string("X-Accel-Buffering", "no"))
|
||||
.andExpect(content().string(org.hamcrest.Matchers.containsString(":connected")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void widgetCatalogRequiresAdminAndPersistsUniqueComponents() throws Exception {
|
||||
String path = "/api/admin/widget-providers";
|
||||
@@ -269,7 +280,7 @@ class LayoutApiTest {
|
||||
var validator = new LayoutValidator();
|
||||
var store = new LayoutStore(database.toString(), mapper, validator);
|
||||
var policy = new RequestPolicy(ADMIN.substring(7), DEVICE.substring(7));
|
||||
return MockMvcBuilders.standaloneSetup(new LayoutController(store, policy, validator, mapper))
|
||||
return MockMvcBuilders.standaloneSetup(new LayoutController(store, policy, validator, mapper, new LayoutEvents(store)))
|
||||
.setControllerAdvice(new ApiExceptionHandler())
|
||||
.addFilters(policy).build();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class UniformityTest {
|
||||
assertEquals(3, layout.path("schemaVersion").intValue());
|
||||
assertEquals(1080, layout.path("canvas").path("designWidth").intValue());
|
||||
assertEquals(1920, layout.path("canvas").path("designHeight").intValue());
|
||||
assertEquals(132, layout.path("canvas").path("safeTop").intValue());
|
||||
assertEquals(72, layout.path("canvas").path("safeTop").intValue());
|
||||
assertEquals(72, layout.path("canvas").path("safeBottom").intValue());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user