Skip to content

Commit

Permalink
HARMONY-1978: Test adding then removing a search value
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyinverso committed Jan 21, 2025
1 parent 74bf305 commit aa1335f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions services/harmony/test/workflow-ui/labels-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,25 @@ describe('labels.js', () => {
expect(noMatchLi.querySelector('#create-label-link').textContent).to.equal('Create/apply "bluez"?');
expect(document.getElementById('labels-li').style.display).to.equal('none');
});
it('hides labels that do not match and subsequently unhides them when the search value is removed', () => {
(document.querySelector('#label-search') as HTMLInputElement).value = 'blu';
Labels.filterLabelsList();
const labelsListElement = document.getElementById('labels-list');
const blueLi = labelsListElement.querySelector('a[name="blue"]').closest('li');
const greenLi = labelsListElement.querySelector('a[name="green"]').closest('li');
const yellowLi = labelsListElement.querySelector('a[name="yellow"]').closest('li');
expect(blueLi.style.display).to.not.equal('none');
expect(greenLi.style.display).to.equal('none');
expect(yellowLi.style.display).to.equal('none');
expect(document.getElementById('labels-li').style.display).to.equal('');

(document.querySelector('#label-search') as HTMLInputElement).value = '';
Labels.filterLabelsList();
expect(blueLi.style.display).to.not.equal('none');
expect(greenLi.style.display).to.not.equal('none');
expect(yellowLi.style.display).to.not.equal('none');
expect(document.getElementById('labels-li').style.display).to.equal('');
});
});
describe('showAllLabels', () => {
it('unhides all labels', () => {
Expand Down

0 comments on commit aa1335f

Please sign in to comment.