Commit 9ac08ac5 by muzaffaryousaf Committed by Andy Armstrong

Moving the country field to the required section of account setting page.

TNL-1856
parent bc05cd0c
......@@ -101,6 +101,7 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest):
'Email Address',
'Password',
'Language',
'Country or Region'
]
},
{
......@@ -109,7 +110,6 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest):
'Education Completed',
'Gender',
'Year of Birth',
'Country or Region',
'Preferred Language',
]
},
......@@ -286,8 +286,8 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest):
self._test_dropdown_field(
u'country',
u'Country or Region',
u'',
[u'Pakistan', u''],
u'Afghanistan',
[u'Pakistan', u'Palau'],
)
def test_preferred_language_field(self):
......
......@@ -148,7 +148,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
var sectionsData = accountSettingsView.options.sectionsData;
expect(sectionsData[0].fields.length).toBe(5);
expect(sectionsData[0].fields.length).toBe(6);
var textFields = [sectionsData[0].fields[1], sectionsData[0].fields[2]];
for (var i = 0; i < textFields.length ; i++) {
......@@ -165,10 +165,14 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
}, requests);
}
expect(sectionsData[1].fields.length).toBe(5);
for (var i = 0; i < 4; i++) {
var view = sectionsData[1].fields[i].view;
expect(sectionsData[1].fields.length).toBe(4);
var dropdownFields = [
sectionsData[1].fields[0],
sectionsData[1].fields[1],
sectionsData[1].fields[2]
];
_.each(dropdownFields, function(field) {
var view = field.view;
FieldViewsSpecHelpers.verifyDropDownField(view, {
title: view.options.title,
valueAttribute: view.options.valueAttribute,
......@@ -178,7 +182,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
invalidValue2: Helpers.FIELD_OPTIONS[3][0],
validationError: "Nope, this will not do!"
}, requests);
}
});
var section2Fields = sectionsData[2].fields;
expect(section2Fields.length).toBe(2);
......
......@@ -81,6 +81,15 @@
),
options: fieldsData.language.options
})
},
{
view: new FieldViews.DropdownFieldView({
model: userAccountModel,
required: true,
title: gettext('Country or Region'),
valueAttribute: 'country',
options: fieldsData['country']['options']
})
}
]
},
......@@ -108,15 +117,7 @@
model: userAccountModel,
title: gettext('Year of Birth'),
valueAttribute: 'year_of_birth',
options: fieldsData.year_of_birth.options
})
},
{
view: new FieldViews.DropdownFieldView({
model: userAccountModel,
title: gettext('Country or Region'),
valueAttribute: 'country',
options: fieldsData.country.options
options: fieldsData['year_of_birth']['options']
})
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment