Skip to content

Commit

Permalink
Adjust tests for added select item
Browse files Browse the repository at this point in the history
  • Loading branch information
swaterkamp committed Jul 2, 2021
1 parent 264c975 commit ad0c95a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions gsa/src/web/components/powerfilter/__tests__/relationselector.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ describe('Relation Selector Tests', () => {

domItems = getItemElements(baseElement);

expect(domItems.length).toEqual(3);
expect(domItems[0]).toHaveTextContent('is equal to');
expect(domItems[1]).toHaveTextContent('is greater than');
expect(domItems[2]).toHaveTextContent('is less than');
expect(domItems.length).toEqual(4);
expect(domItems[0]).toHaveTextContent('--');
expect(domItems[1]).toHaveTextContent('is equal to');
expect(domItems[2]).toHaveTextContent('is greater than');
expect(domItems[3]).toHaveTextContent('is less than');
});

test('should call onChange handler', () => {
Expand All @@ -69,7 +70,7 @@ describe('Relation Selector Tests', () => {

const domItems = getItemElements(baseElement);

fireEvent.click(domItems[0]);
fireEvent.click(domItems[1]);

expect(onChange).toBeCalled();
expect(onChange).toBeCalledWith('=', undefined);
Expand All @@ -89,7 +90,7 @@ describe('Relation Selector Tests', () => {

const domItems = getItemElements(baseElement);

fireEvent.click(domItems[2]);
fireEvent.click(domItems[3]);

expect(onChange).toBeCalled();
expect(onChange).toBeCalledWith('<', undefined);
Expand All @@ -103,7 +104,7 @@ describe('Relation Selector Tests', () => {
openSelectElement(element);

let domItems = getItemElements(baseElement);
expect(domItems.length).toEqual(3);
expect(domItems.length).toEqual(4);

const input = getInputBox(baseElement);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('Severity Values Group Tests', () => {

const domItems = getItemElements(baseElement);

fireEvent.click(domItems[2]);
fireEvent.click(domItems[3]);

expect(onChange).toBeCalled();
expect(onChange).toBeCalledWith(3, 'severity', '<');
Expand Down

0 comments on commit ad0c95a

Please sign in to comment.