Class AvatarGroupTester
-
- All Implemented Interfaces:
-
com.vaadin.browserless.Clickable
public class AvatarGroupTester<T extends AvatarGroup> extends ComponentTester<T>
Tester for AvatarGroup components.
AvatarGroup has no server-side listeners: everything the user can do with it happens in the browser without a round trip. This tester is therefore assertion-only, and reports which items are shown as individual avatars and which ones are grouped behind the overflow avatar.
The split is derived from getMaxItemsVisible only. Without a browser there is no layout, so the additional truncation the component applies when the avatars do not fit the available width cannot be taken into account.
- Since:
25.3
-
-
Constructor Summary
Constructors Constructor Description AvatarGroupTester(T component)Wrap given component for testing.
-
Method Summary
Modifier and Type Method Description List<AvatarGroup.AvatarGroupItem>getItems()Gets all items of the group, whether or not they are shown as individual avatars. List<AvatarGroup.AvatarGroupItem>getVisibleItems()Gets the items that are shown as individual avatars. List<AvatarGroup.AvatarGroupItem>getOverflowItems()Gets the items that do not fit getMaxItemsVisible and are grouped behind the overflow avatar. StringgetOverflowAbbreviation()Gets the abbreviation shown on the overflow avatar, such as "+3".StringgetActiveUsersLabel()Gets the accessible label of the group, that is, the one or many active users phrase with {count}replaced by the total number of items.-
Methods inherited from class com.vaadin.browserless.ComponentTester
blur, ensureComponentIsUsable, find, focus, getComponent, isFocused, isUsable, setModal -
Methods inherited from class com.vaadin.browserless.Clickable
click, click, click, middleClick, middleClick, rightClick, rightClick -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AvatarGroupTester
AvatarGroupTester(T component)
Wrap given component for testing.
- Parameters:
component- target component
-
-
Method Detail
-
getItems
List<AvatarGroup.AvatarGroupItem> getItems()
Gets all items of the group, whether or not they are shown as individual avatars.
- Returns:
the items of the group
-
getVisibleItems
List<AvatarGroup.AvatarGroupItem> getVisibleItems()
Gets the items that are shown as individual avatars.
- Returns:
the items shown as individual avatars
-
getOverflowItems
List<AvatarGroup.AvatarGroupItem> getOverflowItems()
Gets the items that do not fit getMaxItemsVisible and are grouped behind the overflow avatar.
- Returns:
the overflowing items, empty if nothing overflows
-
getOverflowAbbreviation
@Nullable() String getOverflowAbbreviation()
Gets the abbreviation shown on the overflow avatar, such as
"+3".- Returns:
the overflow abbreviation, or
nullif no items overflow and the overflow avatar is not shown
-
getActiveUsersLabel
@Nullable() String getActiveUsersLabel()
Gets the accessible label of the group, that is, the one or many active users phrase with
{count}replaced by the total number of items.- Returns:
the accessible label, or
nullif no matching translation has been set on the component
-
-
-
-