Skip to content

Commit

Permalink
MNT Don't use deprecated jQuery size() function in behat (#1298)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Oct 31, 2022
1 parent ce33714 commit 14233ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/behat/src/FixtureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function iShouldSeeTheFileStatusFlag()
// TODO This should wait for any XHRs and React rendering to finish
$this->getMainContext()->getSession()->wait(
1000,
"window.jQuery && window.jQuery('.editor__status-flag').size() > 0"
"window.jQuery && window.jQuery('.editor__status-flag').length > 0"
);

$page = $this->getMainContext()->getSession()->getPage();
Expand All @@ -114,7 +114,7 @@ public function iShouldNotSeeTheFileStatusFlag()
*/
public function iShouldSeeTheFileStatusIconWithTheClass($class)
{
$js = "window.jQuery && window.jQuery('.file-status-icon__icon').size() > 0";
$js = "window.jQuery && window.jQuery('.file-status-icon__icon').length > 0";
$this->getMainContext()->getSession()->wait(1000, $js);
$icon = $this->getMainContext()->getSession()->getPage()->find('css', "{$class}.file-status-icon__icon");
Assert::assertNotNull($icon, "File status icon '$class' could not be found");
Expand Down Expand Up @@ -171,7 +171,7 @@ public function iClickOnTheLatestHistoryItem()
{
$this->getMainContext()->getSession()->wait(
5000,
"window.jQuery && window.jQuery('.history-list__list li').size() > 0"
"window.jQuery && window.jQuery('.history-list__list li').length > 0"
);

$page = $this->getMainContext()->getSession()->getPage();
Expand Down

0 comments on commit 14233ba

Please sign in to comment.