Package com.vaadin.flow.component.avatar
Class AvatarGroupTester<T extends AvatarGroup>
java.lang.Object
com.vaadin.browserless.ComponentTester<T>
com.vaadin.flow.component.avatar.AvatarGroupTester<T>
- Type Parameters:
T- component type
- All Implemented Interfaces:
Clickable<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 AvatarGroup.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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetItems()Gets all items of the group, whether or not they are shown as individual avatars.@Nullable StringGets the abbreviation shown on the overflow avatar, such as"+3".Gets the items that do not fitAvatarGroup.getMaxItemsVisible()and are grouped behind the overflow avatar.Gets the items that are shown as individual avatars.Methods inherited from class com.vaadin.browserless.ComponentTester
canSetValueAsUser, clearAsUser, clickClearButtonAsUser, ensureComponentIsUsable, ensureComponentIsUsable, ensureComponentIsUsableOrDetach, ensureVisible, ensureVisible, find, findAllByQuery, findByQuery, fireDomEvent, fireDomEvent, fireDomEvent, getComponent, getField, getField, getMethod, getMethod, isComponentReadOnly, isUsable, isUsable, notUsableReasons, notUsableReasons, roundTrip, setModal, setPropertyAsUser, setValueAsUser, setValueAsUserMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.browserless.Clickable
click, click, click, middleClick, middleClick, rightClick, rightClick
-
Constructor Details
-
AvatarGroupTester
Wrap given component for testing.- Parameters:
component- target component
-
-
Method Details
-
getItems
Gets all items of the group, whether or not they are shown as individual avatars.- Returns:
- the items of the group
- Throws:
IllegalStateException- if the group is not visible to the user
-
getVisibleItems
Gets the items that are shown as individual avatars.- Returns:
- the items shown as individual avatars
- Throws:
IllegalStateException- if the group is not visible to the user
-
getOverflowItems
Gets the items that do not fitAvatarGroup.getMaxItemsVisible()and are grouped behind the overflow avatar.- Returns:
- the overflowing items, empty if nothing overflows
- Throws:
IllegalStateException- if the group is not visible to the user
-
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 - Throws:
IllegalStateException- if the group is not visible to the user
-
getActiveUsersLabel
Gets the accessible label of the group, that is, theoneormanyactive 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 - Throws:
IllegalStateException- if the group is not visible to the user
-