I am in need of testing the removal of an event and confirming that it has been successfully removed. Since these events are not unique and can vary in number during testing, I believe using a count would be the most suitable approach.
This is all new to me, so I apologize for any vagueness.
The code snippet below illustrates what I am trying to achieve, but the expectation should be a number. I am currently comparing a start and end count. Can someone guide me in the right direction or provide alternative solutions?
<!-- Insert code here -->
it('should remove the events', async function () {
await browser.get('/');
var removeBtns = element.all(by.id('removeButton')).first();
var startcount = element.all(by.id('removeButton')).count();
console.log(startcount);
removeBtns.click();
element(by.className('...confirm removal of button')).click();
var endcount = element.all(by.id('removeButton')).count();
console.log(endcount);
expect(endcount).toBeLessThan(startcount);
<!-- Insert code here -->
The error message received: No overload matches this call.
Overload 1 of 2, '(expected: number | Promise, expectationFailOutput?: any): Promise', gave the following error.
Argument of type 'Promise' is not assignable to parameter of type 'number | Promise'.
Type 'Promise' is missing the following properties from type 'Promise': [Symbol.toStringTag], finally
Overload 2 of 2, '(expected: number, expectationFailOutput?: any): boolean', gave the following error.
Argument of type 'Promise' is not assignable to parameter of type 'number'.