-
Notifications
You must be signed in to change notification settings - Fork 2.3k
chore(test): clean up no control flow typescript tests #5023
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these tests seem like they might not make sense now, but we might as well port them over and review later.
await browser.get('index.html#/form'); | ||
|
||
const usernameInput = element(by.model('username')); | ||
const name = element(by.binding('username')); | ||
|
||
await expect(name.getText()).toEqual('Anon'); | ||
expect(await name.getText()).toEqual('Anon'); | ||
|
||
await((usernameInput.clear() as any) as ElementFinder).sendKeys('Jane'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wat? Can't this at least be (usernameInput.clear() as ElementFinder)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. wat is right. I might need to fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Casting it just directly to ElementFinder
does not work as shown above. Per the documentation, the return type is webdriver.promise.Promise.<void>
so I'm not sure how this actually works. Shouldn't it return a promise for an ElementFinder? That would make more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, yeah it should be as Promise<ElementFinder>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a TODO to fix this and it is logged as an issue.
No description provided.