Skip to content
Snippets Groups Projects
Commit cf986400 authored by utkarsh_33's avatar utkarsh_33 Committed by Chris Wells
Browse files

Issue #3499411: After composer error on install, card incorrectly reflects "Installed" status

parent 8055d95f
No related branches found
No related tags found
1 merge request!679#3499411:After composer error on install, card incorrectly reflects "Installed" status
Pipeline #408291 passed
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -48,6 +48,10 @@ export const handleError = async (errorResponse) => {
} else {
div.innerHTML += `<p>${errorMessage}</p>`;
}
const currentQueueList = get(queueList) || [];
for (const project of currentQueueList) {
project.error = errorMessage;
}
openPopup(div, { title: 'Error while installing package(s)' });
};
......@@ -196,6 +200,8 @@ export const processQueue = async () => {
clearQueue();
for (const project of currentQueueList) {
project.status = 'active';
if(!project.error) {
project.status = 'active';
}
}
};
......@@ -485,4 +485,31 @@ class ProjectBrowserInstallerUiTest extends WebDriverTestBase {
$this->assertTrue($was_selected);
}
/**
* Tests that the install state does not change on error.
*/
public function testInstallStatusUnchangedOnError(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
// Start install begin.
$this->drupalGet('admin/modules/project_browser/install-begin', [
'query' => ['source' => 'project_browser_test_mock'],
]);
$this->drupalGet('admin/modules/browse/project_browser_test_mock');
$this->svelteInitHelper('text', 'Cream cheese on a bagel');
// Try beginning another install while one is in progress, but not yet in
// the applying stage.
$cream_cheese_module_selector = '#project-browser .pb-layout__main ul > li:nth-child(1)';
$cream_cheese_button = $page->find('css', "$cream_cheese_module_selector button.pb__action_button");
$cream_cheese_button?->click();
// Close the dialog to assert the state of install button.
$page->find('css', '.ui-dialog-titlebar-close')?->click();
$download_button = $assert_session->waitForElementVisible('css', "$cream_cheese_module_selector button.pb__action_button");
$this->assertNotEmpty($download_button);
// Assertion that the install state does not change.
$this->assertSame('Install Cream cheese on a bagel', $download_button->getText());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment