Support for joined date to profile.
LEARNER-1858
This commit is contained in:
committed by
Diana Huang
parent
98ee25fbab
commit
7cc9400b91
@@ -222,7 +222,7 @@ class TestAccountsAPI(CacheIsolationTestCase, UserAPITestCase):
|
||||
Verify that the shareable fields from the account are returned
|
||||
"""
|
||||
data = response.data
|
||||
self.assertEqual(8, len(data))
|
||||
self.assertEqual(9, len(data))
|
||||
self.assertEqual(self.user.username, data["username"])
|
||||
self.assertEqual("US", data["country"])
|
||||
self._verify_profile_image_data(data, True)
|
||||
|
||||
@@ -103,6 +103,18 @@
|
||||
});
|
||||
|
||||
sectionOneFieldViews = [
|
||||
new FieldsView.DateFieldView({
|
||||
title: gettext('Joined'),
|
||||
titleVisible: true,
|
||||
model: accountSettingsModel,
|
||||
screenReaderTitle: gettext('Joined Date'),
|
||||
valueAttribute: 'date_joined',
|
||||
helpMessage: '',
|
||||
userLanguage: accountSettingsModel.get('language'),
|
||||
userTimezone: accountPreferencesModel.get('time_zone'),
|
||||
dateFormat: 'MMMM YYYY' // not localized, but hopefully ok.
|
||||
}),
|
||||
|
||||
new FieldsView.DropdownFieldView({
|
||||
title: gettext('Location'),
|
||||
titleVisible: true,
|
||||
|
||||
@@ -103,6 +103,12 @@ define(
|
||||
valueAttribute: 'language_proficiencies',
|
||||
options: Helpers.FIELD_OPTIONS,
|
||||
helpMessage: ''
|
||||
}),
|
||||
|
||||
new FieldViews.DateFieldView({
|
||||
model: accountSettingsModel,
|
||||
valueAttribute: 'date_joined',
|
||||
helpMessage: ''
|
||||
})
|
||||
];
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ define(['underscore', 'URI', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
|
||||
if ('fieldValue' in view || 'imageUrl' in view) {
|
||||
if ('imageUrl' in view) {
|
||||
expect($($element.find('.image-frame')[0]).attr('src')).toBe(view.imageUrl());
|
||||
} else if (view.fieldType === 'date') {
|
||||
expect(view.fieldValue()).toBe(view.timezoneFormattedDate());
|
||||
} else if (view.fieldValue()) {
|
||||
expect(view.fieldValue()).toBe(view.modelValue());
|
||||
} else if ('optionForValue' in view) {
|
||||
@@ -41,7 +43,7 @@ define(['underscore', 'URI', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
|
||||
var expectSectionOneTobeRendered = function(learnerProfileView) {
|
||||
var sectionOneFieldElements = $(learnerProfileView.$('.wrapper-profile-section-one')).find('.u-field');
|
||||
|
||||
expect(sectionOneFieldElements.length).toBe(5);
|
||||
expect(sectionOneFieldElements.length).toBe(6);
|
||||
expectProfileElementContainsField(sectionOneFieldElements[0], learnerProfileView.options.profileImageFieldView);
|
||||
expectProfileElementContainsField(sectionOneFieldElements[1], learnerProfileView.options.usernameFieldView);
|
||||
expectProfileElementContainsField(sectionOneFieldElements[2], learnerProfileView.options.nameFieldView);
|
||||
|
||||
Reference in New Issue
Block a user