diff --git a/src/resources/vue/Widgets/Status.vue b/src/resources/vue/Widgets/Status.vue --- a/src/resources/vue/Widgets/Status.vue +++ b/src/resources/vue/Widgets/Status.vue @@ -72,14 +72,22 @@ parseStatusInfo(info) { if (info) { if (!info.isReady) { + let failedCount = 0 + let allCount = info.process.length + info.process.forEach((step, idx) => { - if (!step.state && !('percent' in info)) { - info.title = step.title - info.step = step.label - info.percent = Math.floor(idx / info.process.length * 100); - info.link = step.link + if (!step.state) { + failedCount++ + + if (!info.title) { + info.title = step.title + info.step = step.label + info.link = step.link + } } }) + + info.percent = Math.floor((allCount - failedCount) / allCount * 100); } this.state = info || {} diff --git a/src/tests/Browser/StatusTest.php b/src/tests/Browser/StatusTest.php --- a/src/tests/Browser/StatusTest.php +++ b/src/tests/Browser/StatusTest.php @@ -72,7 +72,7 @@ ->on(new Dashboard()) ->with(new Status(), function ($browser) use ($john) { $browser->assertSeeIn('@body', 'We are preparing your account') - ->assertProgress(28, 'Creating a mailbox...', 'pending') + ->assertProgress(71, 'Creating a mailbox...', 'pending') ->assertMissing('#status-verify') ->assertMissing('#status-link') ->assertMissing('@refresh-button') @@ -123,7 +123,7 @@ $browser->visit(new Dashboard()) ->with(new Status(), function ($browser) use ($john, $domain) { $browser->assertSeeIn('@body', 'We are preparing your account') - ->assertProgress(28, 'Creating a mailbox...', 'failed') + ->assertProgress(71, 'Creating a mailbox...', 'failed') ->assertVisible('@refresh-button') ->assertVisible('@refresh-text'); @@ -238,7 +238,7 @@ }) ->with(new Status(), function ($browser) use ($john) { $browser->assertSeeIn('@body', 'We are preparing the user account') - ->assertProgress(28, 'Creating a mailbox...', 'pending') + ->assertProgress(71, 'Creating a mailbox...', 'pending') ->assertMissing('#status-verify') ->assertMissing('#status-link') ->assertMissing('@refresh-button')