Search in sources :

Example 1 with Teaser

use of com.adobe.cq.wcm.core.components.models.Teaser in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class TeaserImplTest method testTeaserWithHiddenLinks.

@Test
protected void testTeaserWithHiddenLinks() {
    Teaser teaser = getTeaserUnderTest(TEASER_5, Teaser.PN_TITLE_LINK_HIDDEN, true, Teaser.PN_IMAGE_LINK_HIDDEN, true);
    Utils.testJSONExport(teaser, Utils.getTestExporterJSONPath(testBase, "teaser7"));
}
Also used : Teaser(com.adobe.cq.wcm.core.components.models.Teaser) Test(org.junit.jupiter.api.Test)

Example 2 with Teaser

use of com.adobe.cq.wcm.core.components.models.Teaser in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class TeaserImplTest method testTeaserWithActionsDisabled.

@Test
protected void testTeaserWithActionsDisabled() {
    Teaser teaser = getTeaserUnderTest(TEASER_7, Teaser.PN_ACTIONS_DISABLED, true);
    Utils.testJSONExport(teaser, Utils.getTestExporterJSONPath(testBase, "teaser10"));
}
Also used : Teaser(com.adobe.cq.wcm.core.components.models.Teaser) Test(org.junit.jupiter.api.Test)

Example 3 with Teaser

use of com.adobe.cq.wcm.core.components.models.Teaser in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class TeaserImplTest method testTeaserWithTitleNotFromLinkedPageAndNoActions.

@Test
void testTeaserWithTitleNotFromLinkedPageAndNoActions() {
    Teaser teaser = getTeaserUnderTest(TEASER_10);
    assertEquals("Teaser", teaser.getTitle());
    assertTrue(teaser.getActions().isEmpty());
}
Also used : Teaser(com.adobe.cq.wcm.core.components.models.Teaser) Test(org.junit.jupiter.api.Test)

Example 4 with Teaser

use of com.adobe.cq.wcm.core.components.models.Teaser in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class TeaserImplTest method testTeaserWithActions.

@Test
protected void testTeaserWithActions() {
    Teaser teaser = getTeaserUnderTest(TEASER_7);
    assertTrue(teaser.isActionsEnabled(), "Expected teaser with actions");
    assertEquals(2, teaser.getActions().size(), "Expected to find two actions");
    ListItem action = teaser.getActions().get(0);
    assertEquals("http://www.adobe.com", action.getPath(), "Action link does not match");
    assertEquals("Adobe", action.getTitle(), "Action text does not match");
    Utils.testJSONExport(teaser, Utils.getTestExporterJSONPath(testBase, "teaser9"));
}
Also used : Teaser(com.adobe.cq.wcm.core.components.models.Teaser) ListItem(com.adobe.cq.wcm.core.components.models.ListItem) Test(org.junit.jupiter.api.Test)

Example 5 with Teaser

use of com.adobe.cq.wcm.core.components.models.Teaser in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class TeaserImplTest method testPageInheritedProperties.

@Test
protected void testPageInheritedProperties() {
    Teaser teaser = getTeaserUnderTest(TEASER_6);
    assertEquals("Teasers Test", teaser.getTitle());
    // < and > are expected escaped, because the page properties provide only a plain text field for the page description
    assertEquals("Teasers description from &lt;page properties&gt;", teaser.getDescription());
}
Also used : Teaser(com.adobe.cq.wcm.core.components.models.Teaser) Test(org.junit.jupiter.api.Test)

Aggregations

Teaser (com.adobe.cq.wcm.core.components.models.Teaser)37 Test (org.junit.jupiter.api.Test)35 ListItem (com.adobe.cq.wcm.core.components.models.ListItem)4 Link (com.adobe.cq.wcm.core.components.commons.link.Link)3 Resource (org.apache.sling.api.resource.Resource)3 Image (com.adobe.cq.wcm.core.components.models.Image)2 Page (com.day.cq.wcm.api.Page)2 PageManager (com.day.cq.wcm.api.PageManager)2 ValueMap (org.apache.sling.api.resource.ValueMap)2 LinkHandler (com.adobe.cq.wcm.core.components.internal.link.LinkHandler)1 LinkTestUtils.assertValidLink (com.adobe.cq.wcm.core.components.internal.link.LinkTestUtils.assertValidLink)1 CoreResourceWrapper (com.adobe.cq.wcm.core.components.internal.resource.CoreResourceWrapper)1 ExperienceFragment (com.adobe.cq.wcm.core.components.models.ExperienceFragment)1 ComponentUtils (com.adobe.cq.wcm.core.components.util.ComponentUtils)1 DownloadResource (com.day.cq.commons.DownloadResource)1 ImageResource (com.day.cq.commons.ImageResource)1 Template (com.day.cq.wcm.api.Template)1 Designer (com.day.cq.wcm.api.designer.Designer)1 Style (com.day.cq.wcm.api.designer.Style)1 AllowedComponentList (com.day.cq.wcm.foundation.AllowedComponentList)1