Skip to content

Commit 9e27f11

Browse files
committed
Add functional test
Signed-off-by: Matt Friedman <maf675@gmail.com>
1 parent 70d611f commit 9e27f11

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/functional/functional_test.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,19 @@ public function test_ucp_module()
7373
$this->assertContainsLang('NOTIFY_WEBPUSH_ENABLE', $crawler->filter('label[for="subscribe_webpush"]')->text());
7474
$this->assertContainsLang('NOTIFICATION_METHOD_PHPBB_WPN_WEBPUSH', $crawler->filter('th.mark')->eq(2)->text());
7575
}
76+
77+
public function test_dropdown_subscribe_button()
78+
{
79+
$this->login();
80+
81+
$this->add_lang_ext('phpbb/webpushnotifications', 'webpushnotifications_module_ucp');
82+
83+
$crawler = self::request('GET', 'index.php');
84+
$this->assertCount(1, $crawler->filter('.wpn-notification-dropdown-footer'));
85+
$this->assertContainsLang('NOTIFY_WEBPUSH_SUBSCRIBE', $crawler->filter('.wpn-notification-dropdown-footer #subscribe_webpush')->text());
86+
$this->assertContainsLang('NOTIFY_WEBPUSH_SUBSCRIBED', $crawler->filter('.wpn-notification-dropdown-footer #unsubscribe_webpush')->text());
87+
88+
$crawler = self::request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options');
89+
$this->assertCount(0, $crawler->filter('.wpn-notification-dropdown-footer'));
90+
}
7691
}

0 commit comments

Comments
 (0)