Skip to content

Commit

Permalink
#5309 beautify chip
Browse files Browse the repository at this point in the history
  • Loading branch information
pnatashap committed Apr 7, 2024
1 parent 5e50faf commit 9fb57e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ public void sizesChipTests() {
int expectedHeight = 16;
Chip sizeChip = sizesChips.get(1);
sizeChip.show();
sizeChip.has().fontSize(expectedFontSize)
.and().height(expectedHeight)
sizeChip.has().height(expectedHeight)
.and().xSmallSize();
sizesChips.get(2).has().smallSize();
sizesChips.get(3).has().defaultSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,16 @@ public ChipAssert notLabel() {
return this;
}

// @todo #5048 Check if this method usefull
@JDIAction(value = "Assert that ''{name}' filter icon is displayed'", isAssert = true)
public ChipAssert filterIconDisplayed() {
jdiAssert(element().isFilterIconDisplayed(), Matchers.is(true),
jdiAssert(element().filter().isDisplayed(), Matchers.is(true),
"Chip's filter icon is not displayed");
return this;
}

@JDIAction(value = "Assert that ''{name}' filter icon is not displayed'", isAssert = true)
public ChipAssert filterIconNotDisplayed() {
jdiAssert(element().isFilterIconDisplayed(), Matchers.is(false),
jdiAssert(element().filter().isDisplayed(), Matchers.is(false),
"Chip's filter icon is displayed");
return this;
}
Expand All @@ -92,12 +91,6 @@ public ChipAssert image() {
return this;
}

@JDIAction(value = "Assert that '{name}' font size is equal to '{0} px'", isAssert = true)
public ChipAssert fontSize(int fontSize) {
jdiAssert(element().fontSize(), Matchers.equalTo(fontSize));
return this;
}

@JDIAction(value = "Assert that '{name}' size is x-small", isAssert = true)
public ChipAssert xSmallSize() {
jdiAssert(element().hasXSmallSize(), Matchers.is(true), "Chip's size is not x-small");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ public boolean active() {
return core().hasClass("v-chip--active");
}

@JDIAction("Get if '{name}' filter icon is displayed")
public boolean isFilterIconDisplayed() {
return core().find(FILTER_LOCATOR).isDisplayed();
@JDIAction("Get '{name}' filter icon")
public UIElement filter() {
return core().find(FILTER_LOCATOR);
}

// "label" refers to specific element border radius settings
@JDIAction("Get if '{name}' is marked as label chip")
public boolean isLabel() {
return core().hasClass("v-chip--label");
Expand All @@ -77,11 +76,7 @@ public Image image() {
return new Image().setCore(Image.class, core().find(IMAGE_LOCATOR));
}

@JDIAction("Get '{name}' font size")
public int fontSize() {
return Integer.parseInt(core().css("font-size").replace("px", ""));
}

// @todo #5309 Ass interface for sizes (all small, x-small, default, large, x-large)
@JDIAction("Get if '{name}' hss x-small size")
public boolean hasXSmallSize() {
return core().hasClass("v-size--x-small");
Expand Down

0 comments on commit 9fb57e0

Please sign in to comment.