Skip to content

Commit

Permalink
update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Nov 7, 2023
1 parent ef5b554 commit c8cc46a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
<body>

<release version="1.16.0" date="not released">
<action type="update" dev="sseifert" issue="14">
MediaHandlerConfig: Make list of allowed IPE editor types configurable (defaults to "image").
</action>
</release>

<release version="1.15.8" date="2023-09-08">
<action type="update" dev="joerghoh" issue="22">
DAM Renditions: Read width/height of rendition lazy, as this can be expensive when not configured properly or Asset metadata is missing for other reasons.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.util.Set;
Expand Down Expand Up @@ -98,7 +99,6 @@ void setUp() throws Exception {
when(componentContext.getEditContext()).thenReturn(editContext);
when(editContext.getEditConfig()).thenReturn(editConfig);
when(editConfig.getInplaceEditingConfig()).thenReturn(inplaceEditingConfig);
when(inplaceEditingConfig.getConfigPath()).thenReturn("/apps/components/comp1");
when(inplaceEditingConfig.getEditorType()).thenReturn("image");
}

Expand Down Expand Up @@ -201,4 +201,19 @@ void testCanSetCustomIPECropRatios_AUTO() {
assertTrue(MediaMarkupBuilderUtil.canSetCustomIPECropRatios(mediaRequest, componentContext));
}

@Test
void testCanSetCustomIPECropRatios_AUTO_IPEConfigPath() {
MediaRequest mediaRequest = new MediaRequest("/content/dam/path", new MediaArgs().ipeRatioCustomize(IPERatioCustomize.AUTO));
when(inplaceEditingConfig.getConfigPath()).thenReturn("/apps/components/comp1");
assertTrue(MediaMarkupBuilderUtil.canSetCustomIPECropRatios(mediaRequest, componentContext));
}

@Test
void testCanSetCustomIPECropRatios_AUTO_ExistingRatios() {
MediaRequest mediaRequest = new MediaRequest("/content/dam/path", new MediaArgs().ipeRatioCustomize(IPERatioCustomize.AUTO));
when(inplaceEditingConfig.getConfigPath()).thenReturn("/apps/components/comp1");
when(resolver.getResource("/apps/components/comp1/plugins/crop/aspectRatios")).thenReturn(mock(Resource.class));
assertFalse(MediaMarkupBuilderUtil.canSetCustomIPECropRatios(mediaRequest, componentContext));
}

}

0 comments on commit c8cc46a

Please sign in to comment.