1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

[ticket/17344] Improve webpush class names

PHPBB-17344
This commit is contained in:
Matt Friedman
2024-06-16 09:43:02 -07:00
parent f3ca92ffe7
commit 16743e9345
6 changed files with 16 additions and 19 deletions

View File

@@ -99,19 +99,19 @@ class phpbb_functional_notification_webpush_test extends phpbb_functional_test_c
// Assert subscribe dropdown is present
$crawler = self::request('GET', 'index.php');
$this->assertCount(1, $crawler->filter('.notification-dropdown-footer'));
$this->assertContainsLang('NOTIFY_WEB_PUSH_SUBSCRIBE', $crawler->filter('.notification-dropdown-footer #subscribe_webpush')->text());
$this->assertContainsLang('NOTIFY_WEB_PUSH_SUBSCRIBED', $crawler->filter('.notification-dropdown-footer #unsubscribe_webpush')->text());
$this->assertCount(1, $crawler->filter('.webpush-subscribe'));
$this->assertContainsLang('NOTIFY_WEB_PUSH_SUBSCRIBE', $crawler->filter('.webpush-subscribe #subscribe_webpush')->text());
$this->assertContainsLang('NOTIFY_WEB_PUSH_SUBSCRIBED', $crawler->filter('.webpush-subscribe #unsubscribe_webpush')->text());
// Assert subscribe button is not displayed in UCP when dropdown subscribe is present
$crawler = self::request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options');
$this->assertCount(0, $crawler->filter('.notification-dropdown-footer'));
$this->assertCount(0, $crawler->filter('.webpush-subscribe'));
$this->set_acp_option('webpush_dropdown_subscribe', 0);
// Assert subscribe dropdown is not present by default
$crawler = self::request('GET', 'index.php');
$this->assertCount(0, $crawler->filter('.notification-dropdown-footer'));
$this->assertCount(0, $crawler->filter('.webpush-subscribe'));
}
protected function set_acp_option($option, $value)