Skip to content
Snippets Groups Projects
Commit be7d08ec authored by Narendra Singh Rathore's avatar Narendra Singh Rathore Committed by Chris Wells
Browse files

Issue #3511942 by narendrar, phenaproxima, chrisfromredfin, utkarsh_33: The...

Issue #3511942 by narendrar, phenaproxima, chrisfromredfin, utkarsh_33: The filters are not selected for correct instance in case of multiple PB instances
parent f5c766fb
Branches
Tags
1 merge request!782Component specific filter key
Pipeline #447552 failed
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -200,10 +200,9 @@
>
{#each Object.entries(choices) as [id, label]}
<div class="pb-filter__checkbox__container">
<label for={id}>
<label>
<input
type="checkbox"
{id}
class="pb-filter__checkbox form-checkbox form-boolean form-boolean--type-checkbox"
bind:group={$filters[name]}
on:change={onChange}
......
......@@ -191,6 +191,18 @@ final class MultipleInstancesTest extends WebDriverTestBase {
* Tests that category filters apply independently to each instance.
*/
public function testCategoriesFilterIsIndependent(): void {
// Ensure that clicking a category's label (as opposed to checking the box)
// checks the box in the correct instance.
$this->assertSession()
->elementExists('css', '.pb-filter__multi-dropdown__label', $this->instances[1])
->click();
$label = $this->instances[1]->findField('E-commerce')?->getParent();
$this->assertNotEmpty($label);
$this->assertSame('label', $label->getTagName());
$label->click();
$this->waitForElementToContainText($this->instances[1], '1 category selected');
$this->assertTrue($label->find('css', 'input')?->isChecked());
$this->instances[0]->pressButton('Clear filters');
$this->waitForElementToContainText($this->instances[0], '25 Results');
$this->instances[1]->pressButton('Clear filters');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment