diff --git a/src/resources/views/documents/receipt.blade.php b/src/resources/views/documents/receipt.blade.php --- a/src/resources/views/documents/receipt.blade.php +++ b/src/resources/views/documents/receipt.blade.php @@ -26,7 +26,7 @@ {!! $customer['customer'] !!} - {{ __('documents.account-id') }} {{ $customer['wallet_id'] }}
+ {{--{{ __('documents.account-id') }} {{ $customer['wallet_id'] }}
--}} {{ __('documents.customer-no') }} {{ $customer['id'] }} diff --git a/src/resources/vue/User/Profile.vue b/src/resources/vue/User/Profile.vue --- a/src/resources/vue/User/Profile.vue +++ b/src/resources/vue/User/Profile.vue @@ -5,6 +5,12 @@
Your profile
+
+ +
+ {{ user_id }} +
+
@@ -80,6 +86,7 @@ data() { return { profile: {}, + user_id: null, wallet_id: null, countries: window.config.countries } @@ -87,6 +94,7 @@ created() { this.wallet_id = this.$store.state.authInfo.wallet.id this.profile = this.$store.state.authInfo.settings + this.user_id = this.$store.state.authInfo.id }, mounted() { $('#first_name').focus() @@ -99,7 +107,7 @@ this.$root.clearFormValidation($('#user-profile form')) - axios.put('/api/v4/users/' + this.$store.state.authInfo.id, this.profile) + axios.put('/api/v4/users/' + this.user_id, this.profile) .then(response => { delete this.profile.password delete this.profile.password_confirm diff --git a/src/tests/Browser/UserProfileTest.php b/src/tests/Browser/UserProfileTest.php --- a/src/tests/Browser/UserProfileTest.php +++ b/src/tests/Browser/UserProfileTest.php @@ -71,26 +71,29 @@ ->on(new UserProfile()) ->assertSeeIn('#user-profile .button-delete', 'Delete account') ->whenAvailable('@form', function (Browser $browser) { + $user = User::where('email', 'john@kolab.org')->first(); // Assert form content - $browser->assertFocused('div.row:nth-child(1) input') - ->assertSeeIn('div.row:nth-child(1) label', 'First name') - ->assertValue('div.row:nth-child(1) input[type=text]', $this->profile['first_name']) - ->assertSeeIn('div.row:nth-child(2) label', 'Last name') - ->assertValue('div.row:nth-child(2) input[type=text]', $this->profile['last_name']) - ->assertSeeIn('div.row:nth-child(3) label', 'Organization') - ->assertValue('div.row:nth-child(3) input[type=text]', $this->profile['organization']) - ->assertSeeIn('div.row:nth-child(4) label', 'Phone') - ->assertValue('div.row:nth-child(4) input[type=text]', $this->profile['phone']) - ->assertSeeIn('div.row:nth-child(5) label', 'External email') - ->assertValue('div.row:nth-child(5) input[type=text]', $this->profile['external_email']) - ->assertSeeIn('div.row:nth-child(6) label', 'Address') - ->assertValue('div.row:nth-child(6) textarea', $this->profile['billing_address']) - ->assertSeeIn('div.row:nth-child(7) label', 'Country') - ->assertValue('div.row:nth-child(7) select', $this->profile['country']) - ->assertSeeIn('div.row:nth-child(8) label', 'Password') - ->assertValue('div.row:nth-child(8) input[type=password]', '') - ->assertSeeIn('div.row:nth-child(9) label', 'Confirm password') + $browser->assertFocused('div.row:nth-child(2) input') + ->assertSeeIn('div.row:nth-child(1) label', 'Customer No.') + ->assertSeeIn('div.row:nth-child(1) .form-control-plaintext', $user->id) + ->assertSeeIn('div.row:nth-child(2) label', 'First name') + ->assertValue('div.row:nth-child(2) input[type=text]', $this->profile['first_name']) + ->assertSeeIn('div.row:nth-child(3) label', 'Last name') + ->assertValue('div.row:nth-child(3) input[type=text]', $this->profile['last_name']) + ->assertSeeIn('div.row:nth-child(4) label', 'Organization') + ->assertValue('div.row:nth-child(4) input[type=text]', $this->profile['organization']) + ->assertSeeIn('div.row:nth-child(5) label', 'Phone') + ->assertValue('div.row:nth-child(5) input[type=text]', $this->profile['phone']) + ->assertSeeIn('div.row:nth-child(6) label', 'External email') + ->assertValue('div.row:nth-child(6) input[type=text]', $this->profile['external_email']) + ->assertSeeIn('div.row:nth-child(7) label', 'Address') + ->assertValue('div.row:nth-child(7) textarea', $this->profile['billing_address']) + ->assertSeeIn('div.row:nth-child(8) label', 'Country') + ->assertValue('div.row:nth-child(8) select', $this->profile['country']) + ->assertSeeIn('div.row:nth-child(9) label', 'Password') ->assertValue('div.row:nth-child(9) input[type=password]', '') + ->assertSeeIn('div.row:nth-child(10) label', 'Confirm password') + ->assertValue('div.row:nth-child(10) input[type=password]', '') ->assertSeeIn('button[type=submit]', 'Submit'); // Clear all fields and submit diff --git a/src/tests/Feature/Documents/ReceiptTest.php b/src/tests/Feature/Documents/ReceiptTest.php --- a/src/tests/Feature/Documents/ReceiptTest.php +++ b/src/tests/Feature/Documents/ReceiptTest.php @@ -85,7 +85,7 @@ $customerExpected = "Firstname Lastname\nTest Unicode Straße 150\n10115 Berlin"; $this->assertSame($customerExpected, $this->getNodeContent($customerCells[0])); $customerIdents = $this->getNodeContent($customerCells[1]); - $this->assertTrue(strpos($customerIdents, "Account ID {$wallet->id}") !== false); + //$this->assertTrue(strpos($customerIdents, "Account ID {$wallet->id}") !== false); $this->assertTrue(strpos($customerIdents, "Customer No. {$wallet->owner->id}") !== false); // Company details in the footer