Merge lp:~renatofilho/address-book-app/fix-phone-number-field into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 190
Merged at revision: 189
Proposed branch: lp:~renatofilho/address-book-app/fix-phone-number-field
Merge into: lp:address-book-app
Diff against target: 138 lines (+24/-19)
5 files modified
src/imports/ContactEdit/TextInputDetail.qml (+5/-1)
tests/autopilot/address_book_app/data.py (+1/-1)
tests/autopilot/address_book_app/tests/test_add_contact.py (+10/-10)
tests/autopilot/address_book_app/tests/test_data.py (+1/-1)
tests/autopilot/address_book_app/tests/test_edit_contact.py (+7/-6)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-phone-number-field
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+219905@code.launchpad.net

Commit message

Fixed phone number field cleanup.

To post a comment you must log in.
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Are there any related MPs required for this MP to build/function as expected? NO

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes) YES
Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator? YES

Did you successfully run all tests found in your component's Test Plan on device or emulator? YES

If you changed the UI, was the change specified/approved by design? N/A

If you changed the packaging (debian), did you subscribe a core-dev to this MP? N/A

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Yes

Did CI run pass? If not, please explain why.
Yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

Code looks good and works as expected.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/imports/ContactEdit/TextInputDetail.qml'
--- src/imports/ContactEdit/TextInputDetail.qml 2014-05-13 18:54:26 +0000
+++ src/imports/ContactEdit/TextInputDetail.qml 2014-05-16 20:35:15 +0000
@@ -41,7 +41,6 @@
4141
42 readOnly: detail ? detail.readOnly : true42 readOnly: detail ? detail.readOnly : true
43 focus: true43 focus: true
44 text: originalValue ? originalValue : ""
45 style: TextFieldStyle {44 style: TextFieldStyle {
46 overlaySpacing: 045 overlaySpacing: 0
47 frameSpacing: 046 frameSpacing: 0
@@ -62,4 +61,9 @@
62 }61 }
6362
64 Keys.onReturnPressed: application.sendTabEvent();63 Keys.onReturnPressed: application.sendTabEvent();
64 onOriginalValueChanged: {
65 if (originalValue && (originalValue !== "")) {
66 text = originalValue
67 }
68 }
65}69}
6670
=== modified file 'tests/autopilot/address_book_app/data.py'
--- tests/autopilot/address_book_app/data.py 2014-03-27 19:37:33 +0000
+++ tests/autopilot/address_book_app/data.py 2014-05-16 20:35:15 +0000
@@ -53,7 +53,7 @@
53 @classmethod53 @classmethod
54 def make(cls):54 def make(cls):
55 """Return a Phone data object."""55 """Return a Phone data object."""
56 return cls(type_='Mobile', number='81 8777 7755')56 return cls(type_='Mobile', number='(818) 777-7755')
5757
5858
59class Email(DataMixin):59class Email(DataMixin):
6060
=== modified file 'tests/autopilot/address_book_app/tests/test_add_contact.py'
--- tests/autopilot/address_book_app/tests/test_add_contact.py 2014-05-07 18:02:58 +0000
+++ tests/autopilot/address_book_app/tests/test_add_contact.py 2014-05-16 20:35:15 +0000
@@ -229,15 +229,15 @@
229 data.Contact(first_name='Sherlock', last_name='Holmes'))229 data.Contact(first_name='Sherlock', last_name='Holmes'))
230230
231 # Home231 # Home
232 self.set_phone_number(0, "00 0000 0000", 0)232 self.set_phone_number(0, "(000) 000-0000", 0)
233 # Work233 # Work
234 self.set_phone_number(1, "11 1111 1111", 1)234 self.set_phone_number(1, "(000) 000-0001", 1)
235 # Mobile235 # Mobile
236 self.set_phone_number(2, "22 2222 2222", 2)236 self.set_phone_number(2, "(000) 000-0002", 2)
237 # Work Mobile237 # Work Mobile
238 self.set_phone_number(3, "33 3333 3333", 3)238 self.set_phone_number(3, "(000) 000-0003", 3)
239 # Other239 # Other
240 self.set_phone_number(4, "44 4444 4444", 4)240 self.set_phone_number(4, "(000) 000-0004", 4)
241241
242 # Save contact242 # Save contact
243 self.main_window.save()243 self.main_window.save()
@@ -255,11 +255,11 @@
255 objectName="phones")255 objectName="phones")
256 self.assertThat(phone_group.detailsCount, Eventually(Equals(5)))256 self.assertThat(phone_group.detailsCount, Eventually(Equals(5)))
257257
258 phones = {"00 0000 0000" : "Home",258 phones = {"(000) 000-0000" : "Home",
259 "11 1111 1111" : "Work",259 "(000) 000-0001" : "Work",
260 "22 2222 2222" : "Mobile",260 "(000) 000-0002" : "Mobile",
261 "33 3333 3333" : "Work Mobile",261 "(000) 000-0003" : "Work Mobile",
262 "44 4444 4444" : "Other"}262 "(000) 000-0004" : "Other"}
263263
264 # Check if they have the correct label264 # Check if they have the correct label
265 for idx in range(5):265 for idx in range(5):
266266
=== modified file 'tests/autopilot/address_book_app/tests/test_data.py'
--- tests/autopilot/address_book_app/tests/test_data.py 2014-03-01 12:07:36 +0000
+++ tests/autopilot/address_book_app/tests/test_data.py 2014-05-16 20:35:15 +0000
@@ -42,7 +42,7 @@
42 phone = data.Phone.make()42 phone = data.Phone.make()
4343
44 self.assertEqual(phone.type, 'Mobile')44 self.assertEqual(phone.type, 'Mobile')
45 self.assertEqual(phone.number, '81 8777 7755')45 self.assertEqual(phone.number, '(818) 777-7755')
4646
47 def test_make_phone_with_unknown_type(self):47 def test_make_phone_with_unknown_type(self):
48 """Test the error when we try to create a phone with a wrong type."""48 """Test the error when we try to create a phone with a wrong type."""
4949
=== modified file 'tests/autopilot/address_book_app/tests/test_edit_contact.py'
--- tests/autopilot/address_book_app/tests/test_edit_contact.py 2014-03-26 19:30:14 +0000
+++ tests/autopilot/address_book_app/tests/test_edit_contact.py 2014-05-16 20:35:15 +0000
@@ -15,9 +15,10 @@
1515
16class TestEditContact(AddressBookAppTestCase):16class TestEditContact(AddressBookAppTestCase):
17 """Tests edit a contact"""17 """Tests edit a contact"""
18 PHONE_NUMBERS = ['(333) 123-4567', '(333) 123-4568', '(222) 222-2222']
1819
19 def test_add_new_phone(self):20 def test_add_new_phone(self):
20 self.add_contact("Fulano", "de Tal", ["3321 2300"])21 self.add_contact("Fulano", "de Tal", [self.PHONE_NUMBERS[0]])
21 edit_page = self.edit_contact(0)22 edit_page = self.edit_contact(0)
2223
23 # Add a new phone24 # Add a new phone
@@ -30,7 +31,7 @@
30 phone_number_1 = self.main_window.select_single(31 phone_number_1 = self.main_window.select_single(
31 "TextInputDetail",32 "TextInputDetail",
32 objectName="phoneNumber_1")33 objectName="phoneNumber_1")
33 self.type_on_field(phone_number_1, "22 2222 2222")34 self.type_on_field(phone_number_1, self.PHONE_NUMBERS[1])
3435
35 self.main_window.save()36 self.main_window.save()
3637
@@ -48,11 +49,11 @@
48 phone_label_1 = view_page.select_single(49 phone_label_1 = view_page.select_single(
49 "Label",50 "Label",
50 objectName="label_phoneNumber_1.0")51 objectName="label_phoneNumber_1.0")
51 self.assertThat(phone_label_1.text, Eventually(Equals("22 2222 2222")))52 self.assertThat(phone_label_1.text, Eventually(Equals(self.PHONE_NUMBERS[1])))
5253
53 def test_remove_phone(self):54 def test_remove_phone(self):
54 self.add_contact("Fulano", "de Tal", ["3321 2300", "3321 2301"])55 self.add_contact("Fulano", "de Tal", self.PHONE_NUMBERS[1:3])
55 self.edit_contact(0)56 edit_page = self.edit_contact(0)
5657
57 # clear phone 158 # clear phone 1
58 phone_number_1 = self.main_window.select_single(59 phone_number_1 = self.main_window.select_single(
@@ -74,7 +75,7 @@
74 phone_label_1 = view_page.select_single(75 phone_label_1 = view_page.select_single(
75 "Label",76 "Label",
76 objectName="label_phoneNumber_0.0")77 objectName="label_phoneNumber_0.0")
77 self.assertThat(phone_label_1.text, Eventually(Equals("3321 2300")))78 self.assertThat(phone_label_1.text, Eventually(Equals(self.PHONE_NUMBERS[1])))
7879
79 def test_add_email(self):80 def test_add_email(self):
80 self.add_contact("Fulano", "")81 self.add_contact("Fulano", "")

Subscribers

People subscribed via source and target branches