Skip to content

Commit

Permalink
Add e2e tests for Namespace Filter selection
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Rak <[email protected]>
  • Loading branch information
rak-phillip committed Sep 19, 2024
1 parent 59bd209 commit 2d04c82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cypress/e2e/po/components/namespace-filter.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class NamespaceFilterPo extends ComponentPo {
}

searchByName(label: string) {
return this.self().find('.ns-controls > .ns-input').clear().type(label);
return this.self().find('.ns-controls > .ns-input > .ns-filter-input').clear().type(label);
}

clearSearchFilter() {
Expand Down
12 changes: 12 additions & 0 deletions cypress/e2e/tests/pages/explorer2/namespace-picker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ describe('Namespace picker', { testIsolation: 'off' }, () => {
namespacePicker.checkIcon().should('have.length', 1);
});

it('can filter after making a selection', { tags: ['@explorer2', '@adminUser', '@standardUser'] }, () => {
namespacePicker.toggle();

// Select 'Project: Default'
namespacePicker.clickOptionByLabel('Project: Default');
namespacePicker.isChecked('Project: Default');
namespacePicker.checkIcon().should('have.length', 1);

namespacePicker.searchByName('cattle-logging-system');
namespacePicker.getOptions().find('.ns-option').should('have.length.gte', 1);
});

it('can filter options by name', { tags: ['@explorer2', '@adminUser', '@standardUser'] }, () => {
namespacePicker.toggle();

Expand Down

0 comments on commit 2d04c82

Please sign in to comment.