diff --git a/src/resources/vue/Domain/Info.vue b/src/resources/vue/Domain/Info.vue --- a/src/resources/vue/Domain/Info.vue +++ b/src/resources/vue/Domain/Info.vue @@ -53,12 +53,17 @@ }, created() { if (this.domain_id = this.$route.params.domain) { + this.$root.startLoading() + axios.get('/api/v4/domains/' + this.domain_id) .then(response => { + this.$root.stopLoading() this.domain = response.data + if (!this.domain.isConfirmed) { $('#domain-verify button').focus() } + this.status = response.data.statusInfo }) .catch(this.$root.errorHandler) diff --git a/src/resources/vue/Domain/List.vue b/src/resources/vue/Domain/List.vue --- a/src/resources/vue/Domain/List.vue +++ b/src/resources/vue/Domain/List.vue @@ -20,6 +20,11 @@ + + + There are no domains in this account. + + @@ -35,8 +40,11 @@ } }, created() { + this.$root.startLoading() + axios.get('/api/v4/domains') .then(response => { + this.$root.stopLoading() this.domains = response.data }) .catch(this.$root.errorHandler) diff --git a/src/resources/vue/User/List.vue b/src/resources/vue/User/List.vue --- a/src/resources/vue/User/List.vue +++ b/src/resources/vue/User/List.vue @@ -33,6 +33,11 @@ + + + There are no users in this account. + + @@ -73,8 +78,11 @@ } }, created() { + this.$root.startLoading() + axios.get('/api/v4/users') .then(response => { + this.$root.stopLoading() this.users = response.data }) .catch(this.$root.errorHandler) diff --git a/src/tests/Browser/DomainTest.php b/src/tests/Browser/DomainTest.php --- a/src/tests/Browser/DomainTest.php +++ b/src/tests/Browser/DomainTest.php @@ -122,6 +122,7 @@ ->assertVisible('@table tbody tr:first-child td:first-child svg.fa-globe.text-success') ->assertText('@table tbody tr:first-child td:first-child svg title', 'Active') ->assertSeeIn('@table tbody tr:first-child td:first-child', 'kolab.org') + ->assertMissing('@table tfoot') ->click('@table tbody tr:first-child td:first-child a') // On Domain Info page verify that's the clicked domain ->on(new DomainInfo()) @@ -132,4 +133,25 @@ // TODO: Test domains list acting as Ned (John's "delegatee") } + + /** + * Test domains list page (user with no domains) + */ + public function testDomainListEmpty(): void + { + $this->browse(function ($browser) { + // Login the user + $browser->visit('/login') + ->on(new Home()) + ->submitLogon('jack@kolab.org', 'simple123', true) + // On dashboard click the "Domains" link + ->on(new Dashboard()) + ->assertSeeIn('@links a.link-domains', 'Domains') + ->click('@links a.link-domains') + // On Domains List page click the domain entry + ->on(new DomainList()) + ->assertMissing('@table tbody') + ->assertSeeIn('tfoot td', 'There are no domains in this account.'); + }); + } } diff --git a/src/tests/Browser/UsersTest.php b/src/tests/Browser/UsersTest.php --- a/src/tests/Browser/UsersTest.php +++ b/src/tests/Browser/UsersTest.php @@ -116,7 +116,8 @@ ->assertVisible('tbody tr:nth-child(1) button.button-delete') ->assertVisible('tbody tr:nth-child(2) button.button-delete') ->assertVisible('tbody tr:nth-child(3) button.button-delete') - ->assertVisible('tbody tr:nth-child(4) button.button-delete'); + ->assertVisible('tbody tr:nth-child(4) button.button-delete') + ->assertMissing('tfoot'); }); }); } @@ -478,7 +479,8 @@ ->submitLogon('jack@kolab.org', 'simple123', true) ->visit(new UserList()) ->whenAvailable('@table', function (Browser $browser) { - $browser->assertElementsCount('tbody tr', 0); + $browser->assertElementsCount('tbody tr', 0) + ->assertSeeIn('tfoot td', 'There are no users in this account.'); }); });