1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-16 13:00:42 +01:00

Add test for tab

This commit is contained in:
Barry vd. Heuvel 2024-04-01 10:15:07 +02:00
parent 66ad21c0b1
commit 280059431c
2 changed files with 17 additions and 0 deletions

View File

@ -1065,6 +1065,8 @@ if (typeof(PhpDebugBar) == 'undefined') {
'debugbar': this
})});
this.datasetTab.$tab.addClass(csscls('tab-history'));
this.datasetTab.$tab.attr('data-collector', '__datasets');
this.datasetTab.$el.attr('data-collector', '__datasets');
this.datasetTab.$tab.insertAfter(this.$openbtn).hide();
this.datasetTab.$tab.click(() => {
if (!this.isMinimized() && self.activePanelName == '__datasets') {

View File

@ -66,6 +66,21 @@ class DebugbarTest extends AbstractBrowserTest
$client->waitForElementToContain('.phpdebugbar-datasets-switcher', 'ajax_exception.php');
$client->waitForElementToContain('.phpdebugbar-panel[data-collector=exceptions] .phpdebugbar-widgets-message', 'Something failed!');
// Open network tab
$client->click($this->getTabLink($crawler, '__datasets'));
$client->waitForVisibility('.phpdebugbar-panel[data-collector=__datasets] .phpdebugbar-widgets-table-row');
$requests = $crawler->filter('.phpdebugbar-panel[data-collector=__datasets] .phpdebugbar-widgets-table-row')
->each(function(WebDriverElement $node){
return $node->getText();
});
$this->assertStringContainsString('GET /demo/', $requests[0]);
$this->assertStringContainsString('GET /demo/ajax.php (ajax)', $requests[1]);
$this->assertStringContainsString('GET /demo/ajax_exception.php (ajax)', $requests[2]);
}
}