Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/DegradedAccountTest.php
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | public function testDegradedAccountOwner(): void | ||||
->assertSeeIn('#status-degraded p.alert', 'Please, make a payment') | ->assertSeeIn('#status-degraded p.alert', 'Please, make a payment') | ||||
->whenAvailable('@table', function (Browser $browser) { | ->whenAvailable('@table', function (Browser $browser) { | ||||
$browser->waitFor('tbody tr') | $browser->waitFor('tbody tr') | ||||
->assertVisible('tbody tr:nth-child(1) td:first-child svg.text-warning') // Jack | ->assertVisible('tbody tr:nth-child(1) td:first-child svg.text-warning') // Jack | ||||
->assertText('tbody tr:nth-child(2) td:first-child svg.text-warning title', 'Degraded') | ->assertText('tbody tr:nth-child(2) td:first-child svg.text-warning title', 'Degraded') | ||||
->assertVisible('tbody tr:nth-child(3) td:first-child svg.text-warning') // John | ->assertVisible('tbody tr:nth-child(3) td:first-child svg.text-warning') // John | ||||
->assertText('tbody tr:nth-child(3) td:first-child svg.text-warning title', 'Degraded'); | ->assertText('tbody tr:nth-child(3) td:first-child svg.text-warning title', 'Degraded'); | ||||
}) | }) | ||||
->assertMissing('button.create-user'); | ->assertMissing('button.user-new'); | ||||
// Goto /domains and assert that the warning is also displayed there | // Goto /domains and assert that the warning is also displayed there | ||||
$browser->visit(new DomainList()) | $browser->visit(new DomainList()) | ||||
->assertSeeIn('#status-degraded p.alert', 'The account is degraded') | ->assertSeeIn('#status-degraded p.alert', 'The account is degraded') | ||||
->assertSeeIn('#status-degraded p.alert', 'Please, make a payment') | ->assertSeeIn('#status-degraded p.alert', 'Please, make a payment') | ||||
->assertMissing('button.create-domain'); | ->assertMissing('button.domain-new'); | ||||
// Goto /distlists and assert that the warning is also displayed there | // Goto /distlists and assert that the warning is also displayed there | ||||
$browser->visit(new DistlistList()) | $browser->visit(new DistlistList()) | ||||
->assertSeeIn('#status-degraded p.alert', 'The account is degraded') | ->assertSeeIn('#status-degraded p.alert', 'The account is degraded') | ||||
->assertSeeIn('#status-degraded p.alert', 'Please, make a payment') | ->assertSeeIn('#status-degraded p.alert', 'Please, make a payment') | ||||
->assertMissing('button.create-list'); | ->assertMissing('button.distlist-new'); | ||||
// Goto /resources and assert that the warning is also displayed there | // Goto /resources and assert that the warning is also displayed there | ||||
$browser->visit(new ResourceList()) | $browser->visit(new ResourceList()) | ||||
->assertSeeIn('#status-degraded p.alert', 'The account is degraded') | ->assertSeeIn('#status-degraded p.alert', 'The account is degraded') | ||||
->assertSeeIn('#status-degraded p.alert', 'Please, make a payment') | ->assertSeeIn('#status-degraded p.alert', 'Please, make a payment') | ||||
->assertMissing('button.create-resource'); | ->assertMissing('button.resource-new'); | ||||
// Goto /shared-folders and assert that the warning is also displayed there | // Goto /shared-folders and assert that the warning is also displayed there | ||||
$browser->visit(new SharedFolderList()) | $browser->visit(new SharedFolderList()) | ||||
->assertSeeIn('#status-degraded p.alert', 'The account is degraded') | ->assertSeeIn('#status-degraded p.alert', 'The account is degraded') | ||||
->assertSeeIn('#status-degraded p.alert', 'Please, make a payment') | ->assertSeeIn('#status-degraded p.alert', 'Please, make a payment') | ||||
->assertMissing('button.create-resource'); | ->assertMissing('button.shared-folder-new'); | ||||
// Test that /rooms is not accessible | // Test that /rooms is not accessible | ||||
$browser->visit('/rooms') | $browser->visit('/rooms') | ||||
->waitFor('#app > #error-page') | ->waitFor('#app > #error-page') | ||||
->assertSeeIn('#error-page .code', '403'); | ->assertSeeIn('#error-page .code', '403'); | ||||
}); | }); | ||||
} | } | ||||
Show All 14 Lines |