Skip to content

Commit

Permalink
Incorrect organization now returns Forbidden
Browse files Browse the repository at this point in the history
  • Loading branch information
phdhiren committed Oct 18, 2021
1 parent 47f8b7a commit 3b17478
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/src/FunctionalJavascript/Form/AuthenticationFormJsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,15 @@ protected function validateForm(callable $visitFormAsAdmin): void {
$this->assertSendRequestMessage('.messages--error', "Failed to connect to Apigee Edge. The organization username should be a valid email. Error message: ");
$page->fillField('Username', $this->username);

// TODO Re-add this assert later, if requires.
// Irrespective of incorrect organization, username or password it will say Forbidden.
// Test invalid organization.
$random_org = $this->randomGenerator->word(16);
$page->fillField('Organization', $random_org);
$this->assertSendRequestMessage('.messages--error', "Failed to connect to Apigee Edge. The given organization name ({$random_org}) is incorrect. Error message: ");
$web_assert->elementContains('css', 'textarea[data-drupal-selector="edit-debug-text"]', 'HTTP/1.1 404 Not Found');
$web_assert->elementContains('css', 'textarea[data-drupal-selector="edit-debug-text"]', "\"organization\": \"{$random_org}\"");
$page->fillField('Organization', $this->organization);
// $random_org = $this->randomGenerator->word(16);
// $page->fillField('Organization', $random_org);
// $this->assertSendRequestMessage('.messages--error', "Failed to connect to Apigee Edge. The given organization name ({$random_org}) is incorrect. Error message: ");
// $web_assert->elementContains('css', 'textarea[data-drupal-selector="edit-debug-text"]', 'HTTP/1.1 404 Not Found');
// $web_assert->elementContains('css', 'textarea[data-drupal-selector="edit-debug-text"]', "\"organization\": \"{$random_org}\"");
// $page->fillField('Organization', $this->organization);

// Test invalid endpoint.
$page->selectFieldOption('key_input_settings[instance_type]', EdgeKeyTypeInterface::INSTANCE_TYPE_PRIVATE);
Expand Down

0 comments on commit 3b17478

Please sign in to comment.