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
1=== modified file 'src/imports/ContactEdit/TextInputDetail.qml'
2--- src/imports/ContactEdit/TextInputDetail.qml 2014-05-13 18:54:26 +0000
3+++ src/imports/ContactEdit/TextInputDetail.qml 2014-05-16 20:35:15 +0000
4@@ -41,7 +41,6 @@
5
6 readOnly: detail ? detail.readOnly : true
7 focus: true
8- text: originalValue ? originalValue : ""
9 style: TextFieldStyle {
10 overlaySpacing: 0
11 frameSpacing: 0
12@@ -62,4 +61,9 @@
13 }
14
15 Keys.onReturnPressed: application.sendTabEvent();
16+ onOriginalValueChanged: {
17+ if (originalValue && (originalValue !== "")) {
18+ text = originalValue
19+ }
20+ }
21 }
22
23=== modified file 'tests/autopilot/address_book_app/data.py'
24--- tests/autopilot/address_book_app/data.py 2014-03-27 19:37:33 +0000
25+++ tests/autopilot/address_book_app/data.py 2014-05-16 20:35:15 +0000
26@@ -53,7 +53,7 @@
27 @classmethod
28 def make(cls):
29 """Return a Phone data object."""
30- return cls(type_='Mobile', number='81 8777 7755')
31+ return cls(type_='Mobile', number='(818) 777-7755')
32
33
34 class Email(DataMixin):
35
36=== modified file 'tests/autopilot/address_book_app/tests/test_add_contact.py'
37--- tests/autopilot/address_book_app/tests/test_add_contact.py 2014-05-07 18:02:58 +0000
38+++ tests/autopilot/address_book_app/tests/test_add_contact.py 2014-05-16 20:35:15 +0000
39@@ -229,15 +229,15 @@
40 data.Contact(first_name='Sherlock', last_name='Holmes'))
41
42 # Home
43- self.set_phone_number(0, "00 0000 0000", 0)
44+ self.set_phone_number(0, "(000) 000-0000", 0)
45 # Work
46- self.set_phone_number(1, "11 1111 1111", 1)
47+ self.set_phone_number(1, "(000) 000-0001", 1)
48 # Mobile
49- self.set_phone_number(2, "22 2222 2222", 2)
50+ self.set_phone_number(2, "(000) 000-0002", 2)
51 # Work Mobile
52- self.set_phone_number(3, "33 3333 3333", 3)
53+ self.set_phone_number(3, "(000) 000-0003", 3)
54 # Other
55- self.set_phone_number(4, "44 4444 4444", 4)
56+ self.set_phone_number(4, "(000) 000-0004", 4)
57
58 # Save contact
59 self.main_window.save()
60@@ -255,11 +255,11 @@
61 objectName="phones")
62 self.assertThat(phone_group.detailsCount, Eventually(Equals(5)))
63
64- phones = {"00 0000 0000" : "Home",
65- "11 1111 1111" : "Work",
66- "22 2222 2222" : "Mobile",
67- "33 3333 3333" : "Work Mobile",
68- "44 4444 4444" : "Other"}
69+ phones = {"(000) 000-0000" : "Home",
70+ "(000) 000-0001" : "Work",
71+ "(000) 000-0002" : "Mobile",
72+ "(000) 000-0003" : "Work Mobile",
73+ "(000) 000-0004" : "Other"}
74
75 # Check if they have the correct label
76 for idx in range(5):
77
78=== modified file 'tests/autopilot/address_book_app/tests/test_data.py'
79--- tests/autopilot/address_book_app/tests/test_data.py 2014-03-01 12:07:36 +0000
80+++ tests/autopilot/address_book_app/tests/test_data.py 2014-05-16 20:35:15 +0000
81@@ -42,7 +42,7 @@
82 phone = data.Phone.make()
83
84 self.assertEqual(phone.type, 'Mobile')
85- self.assertEqual(phone.number, '81 8777 7755')
86+ self.assertEqual(phone.number, '(818) 777-7755')
87
88 def test_make_phone_with_unknown_type(self):
89 """Test the error when we try to create a phone with a wrong type."""
90
91=== modified file 'tests/autopilot/address_book_app/tests/test_edit_contact.py'
92--- tests/autopilot/address_book_app/tests/test_edit_contact.py 2014-03-26 19:30:14 +0000
93+++ tests/autopilot/address_book_app/tests/test_edit_contact.py 2014-05-16 20:35:15 +0000
94@@ -15,9 +15,10 @@
95
96 class TestEditContact(AddressBookAppTestCase):
97 """Tests edit a contact"""
98+ PHONE_NUMBERS = ['(333) 123-4567', '(333) 123-4568', '(222) 222-2222']
99
100 def test_add_new_phone(self):
101- self.add_contact("Fulano", "de Tal", ["3321 2300"])
102+ self.add_contact("Fulano", "de Tal", [self.PHONE_NUMBERS[0]])
103 edit_page = self.edit_contact(0)
104
105 # Add a new phone
106@@ -30,7 +31,7 @@
107 phone_number_1 = self.main_window.select_single(
108 "TextInputDetail",
109 objectName="phoneNumber_1")
110- self.type_on_field(phone_number_1, "22 2222 2222")
111+ self.type_on_field(phone_number_1, self.PHONE_NUMBERS[1])
112
113 self.main_window.save()
114
115@@ -48,11 +49,11 @@
116 phone_label_1 = view_page.select_single(
117 "Label",
118 objectName="label_phoneNumber_1.0")
119- self.assertThat(phone_label_1.text, Eventually(Equals("22 2222 2222")))
120+ self.assertThat(phone_label_1.text, Eventually(Equals(self.PHONE_NUMBERS[1])))
121
122 def test_remove_phone(self):
123- self.add_contact("Fulano", "de Tal", ["3321 2300", "3321 2301"])
124- self.edit_contact(0)
125+ self.add_contact("Fulano", "de Tal", self.PHONE_NUMBERS[1:3])
126+ edit_page = self.edit_contact(0)
127
128 # clear phone 1
129 phone_number_1 = self.main_window.select_single(
130@@ -74,7 +75,7 @@
131 phone_label_1 = view_page.select_single(
132 "Label",
133 objectName="label_phoneNumber_0.0")
134- self.assertThat(phone_label_1.text, Eventually(Equals("3321 2300")))
135+ self.assertThat(phone_label_1.text, Eventually(Equals(self.PHONE_NUMBERS[1])))
136
137 def test_add_email(self):
138 self.add_contact("Fulano", "")

Subscribers

People subscribed via source and target branches