Skip to content

Commit

Permalink
use expected wait
Browse files Browse the repository at this point in the history
  • Loading branch information
ol0lll committed Sep 4, 2024
1 parent c0cccdb commit a5104db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions tests/src/FunctionalJavascript/ImageUploadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ class ImageUploadTest extends ThunderJavascriptTestBase {
*/
public function testWebpImageUpload(): void {
$this->drupalGet('node/add/article');
$this->assertWaitOnAjaxRequest();

$this->openMediaLibrary('field-teaser-media');
$this->uploadFile(__DIR__ . '/../../fixtures/reference.webp', TRUE);

$this->clickCssSelector('.media-library-widget-modal .form-actions button.button--primary');
$this->assertWaitOnAjaxRequest();
$this->assertExpectedAjaxRequest(1);

$this->clickCssSelector('.media-library-widget-modal .form-actions button.button--primary');
$this->assertExpectedAjaxRequest(1);

/** @var \Drupal\FunctionalJavascriptTests\WebDriverWebAssert $assert_session */
$assert_session = $this->assertSession();
$assert_session->assertExpectedAjaxRequest(1);
// /** @var \Drupal\FunctionalJavascriptTests\WebDriverWebAssert $assert_session */

Check warning on line 31 in tests/src/FunctionalJavascript/ImageUploadTest.php

View workflow job for this annotation

GitHub Actions / drupal-coder (drupal)

[drupal-coder (drupal)] tests/src/FunctionalJavascript/ImageUploadTest.php#L31 <Drupal.Files.LineLength.TooLong>

Line exceeds 80 characters; contains 86 characters
Raw output
/github/workspace/tests/src/FunctionalJavascript/ImageUploadTest.php:31:1: warning: Line exceeds 80 characters; contains 86 characters (Drupal.Files.LineLength.TooLong)

Check failure on line 31 in tests/src/FunctionalJavascript/ImageUploadTest.php

View workflow job for this annotation

GitHub Actions / drupal-coder (drupal)

[drupal-coder (drupal)] tests/src/FunctionalJavascript/ImageUploadTest.php#L31 <Drupal.WhiteSpace.ScopeIndent.IncorrectExact>

Line indented incorrectly; expected 4 spaces, found 0
Raw output
/github/workspace/tests/src/FunctionalJavascript/ImageUploadTest.php:31:1: error: Line indented incorrectly; expected 4 spaces, found 0 (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)

Check failure on line 31 in tests/src/FunctionalJavascript/ImageUploadTest.php

View workflow job for this annotation

GitHub Actions / drupal-coder (drupal)

[drupal-coder (drupal)] tests/src/FunctionalJavascript/ImageUploadTest.php#L31 <Drupal.Commenting.InlineComment.SpacingBefore>

4 spaces found before inline comment; expected "// /** @var \Drupal\FunctionalJavascriptTests\WebDriverWebAssert $assert_session */" but found "// /** @var \Drupal\FunctionalJavascriptTests\WebDriverWebAssert $assert_session */"
Raw output
/github/workspace/tests/src/FunctionalJavascript/ImageUploadTest.php:31:1: error: 4 spaces found before inline comment; expected "// /** @var \Drupal\FunctionalJavascriptTests\WebDriverWebAssert $assert_session */" but found "//    /** @var \Drupal\FunctionalJavascriptTests\WebDriverWebAssert $assert_session */" (Drupal.Commenting.InlineComment.SpacingBefore)
// $assert_session = $this->assertSession();

Check failure on line 32 in tests/src/FunctionalJavascript/ImageUploadTest.php

View workflow job for this annotation

GitHub Actions / drupal-coder (drupal)

[drupal-coder (drupal)] tests/src/FunctionalJavascript/ImageUploadTest.php#L32 <Drupal.WhiteSpace.ScopeIndent.IncorrectExact>

Line indented incorrectly; expected 4 spaces, found 0
Raw output
/github/workspace/tests/src/FunctionalJavascript/ImageUploadTest.php:32:1: error: Line indented incorrectly; expected 4 spaces, found 0 (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
// $assert_session->assertExpectedAjaxRequest(1);

Check warning on line 33 in tests/src/FunctionalJavascript/ImageUploadTest.php

View workflow job for this annotation

GitHub Actions / drupal-coder (drupal)

[drupal-coder (drupal)] tests/src/FunctionalJavascript/ImageUploadTest.php#L33 <Drupal.Commenting.InlineComment.SpacingAfter>

There must be no blank line following an inline comment
Raw output
/github/workspace/tests/src/FunctionalJavascript/ImageUploadTest.php:33:1: warning: There must be no blank line following an inline comment (Drupal.Commenting.InlineComment.SpacingAfter)

Check failure on line 33 in tests/src/FunctionalJavascript/ImageUploadTest.php

View workflow job for this annotation

GitHub Actions / drupal-coder (drupal)

[drupal-coder (drupal)] tests/src/FunctionalJavascript/ImageUploadTest.php#L33 <Drupal.WhiteSpace.ScopeIndent.IncorrectExact>

Line indented incorrectly; expected 4 spaces, found 0
Raw output
/github/workspace/tests/src/FunctionalJavascript/ImageUploadTest.php:33:1: error: Line indented incorrectly; expected 4 spaces, found 0 (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)

Check warning on line 33 in tests/src/FunctionalJavascript/ImageUploadTest.php

View workflow job for this annotation

GitHub Actions / drupal-coder (drupal practice)

[drupal-coder (drupal practice)] tests/src/FunctionalJavascript/ImageUploadTest.php#L33 <DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter>

There must be no blank line following an inline comment
Raw output
/github/workspace/tests/src/FunctionalJavascript/ImageUploadTest.php:33:1: warning: There must be no blank line following an inline comment (DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter)

$this->assertSession()->elementTextContains('css', '.media-library-item__name', 'reference.webp');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public function uploadFile(string $filePath, bool $skipEditForm = FALSE): void {
'(typeof jQuery === "undefined" || !jQuery(\'input[name="op"]\').is(":disabled"))'
);

$this->assertWaitOnAjaxRequest();
$this->assertExpectedAjaxRequest(1);
if (!$skipEditForm) {
$this->assertSession()->elementExists('css', '.ui-dialog-buttonpane')->pressButton('Save and select');
$this->assertWaitOnAjaxRequest();
$this->assertExpectedAjaxRequest(1);
}
}

Expand Down

0 comments on commit a5104db

Please sign in to comment.