Public Access
feat(settings): reduce animations appearance flag
This commit is contained in:
1 parent
a60011ce9f
commit
878ede914b
11 files changed
+30
-17
No files matched your search
@@ -328,7 +328,7 @@ class UserControllerTest extends AbstractWebMvcTest {
|
||||
void getCurrentUser_ShowsAppearance() throws Exception {
|
||||
var email = "test@example.com";
|
||||
var settings = UserSettings.builder().language("en").theme("dark")
|
||||
.appearance(new Appearance("blue", "round", true, 620L, 1086940L, false)).build();
|
||||
.appearance(new Appearance("blue", "round", true, 620L, 1086940L, false, true)).build();
|
||||
SecurityContextHolder.getContext().setAuthentication(
|
||||
new UsernamePasswordAuthenticationToken(new UserPrincipal("1", null), null, Collections.emptyList())
|
||||
);
|
||||
@@ -341,7 +341,8 @@ class UserControllerTest extends AbstractWebMvcTest {
|
||||
.andExpect(jsonPath("$.settings.appearance.wideLayout").value(true))
|
||||
.andExpect(jsonPath("$.settings.appearance.backgroundAppid").value(620))
|
||||
.andExpect(jsonPath("$.settings.appearance.bannerAppid").value(1086940))
|
||||
.andExpect(jsonPath("$.settings.appearance.showBanner").value(false));
|
||||
.andExpect(jsonPath("$.settings.appearance.showBanner").value(false))
|
||||
.andExpect(jsonPath("$.settings.appearance.reduceMotion").value(true));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -629,10 +630,10 @@ class UserControllerTest extends AbstractWebMvcTest {
|
||||
mockMvc.perform(put("/api/users/settings/appearance")
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.content("{\"accent\":\"green\",\"corners\":\"sharp\",\"wideLayout\":true,\"backgroundAppid\":620,"
|
||||
+ "\"bannerAppid\":1086940,\"showBanner\":false}"))
|
||||
+ "\"bannerAppid\":1086940,\"showBanner\":false,\"reduceMotion\":true}"))
|
||||
.andExpect(status().isNoContent());
|
||||
|
||||
verify(userService).updateAppearance(1L, new Appearance("green", "sharp", true, 620L, 1086940L, false));
|
||||
verify(userService).updateAppearance(1L, new Appearance("green", "sharp", true, 620L, 1086940L, false, true));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -645,7 +646,7 @@ class UserControllerTest extends AbstractWebMvcTest {
|
||||
.content("{\"accent\":\"violet\",\"corners\":\"default\"}"))
|
||||
.andExpect(status().isNoContent());
|
||||
|
||||
verify(userService).updateAppearance(1L, new Appearance("violet", "default", false, null, null, true));
|
||||
verify(userService).updateAppearance(1L, new Appearance("violet", "default", false, null, null, true, false));
|
||||
}
|
||||
|
||||
// Each body differs from a valid one in one field only, so the 400 comes from that field's constraint.
|
||||
|
||||
@@ -276,7 +276,7 @@ class UserRepositoryTest extends AbstractPersistenceTest {
|
||||
.registrationDate(LocalDateTime.now())
|
||||
.build());
|
||||
userRepository.update(userEntity.getId(),
|
||||
user -> user.getSettings().setAppearance(new Appearance("pink", "sharp", false, 220L, null, true)));
|
||||
user -> user.getSettings().setAppearance(new Appearance("pink", "sharp", false, 220L, null, true, true)));
|
||||
entityManager.flush();
|
||||
|
||||
updateSettings(userEntity.getId(), null,
|
||||
@@ -285,7 +285,7 @@ class UserRepositoryTest extends AbstractPersistenceTest {
|
||||
entityManager.clear();
|
||||
|
||||
var settings = findByEmail("keep@example.com").orElseThrow().getSettings();
|
||||
assertEquals(new Appearance("pink", "sharp", false, 220L, null, true), settings.getAppearance());
|
||||
assertEquals(new Appearance("pink", "sharp", false, 220L, null, true, true), settings.getAppearance());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -180,7 +180,7 @@ class UserServiceTest extends AbstractUnitTest {
|
||||
|
||||
@Test
|
||||
void updateAppearance_StoresItWithoutANewToken() {
|
||||
var appearance = new Appearance("red", "round", false, null, null, true);
|
||||
var appearance = new Appearance("red", "round", false, null, null, true, false);
|
||||
|
||||
userService.updateAppearance(1L, appearance);
|
||||
|
||||
|
||||
Reference in new issue
Block a user