Skip to content

Commit 70a52f5

Browse files
committed
spec: convert coffeescript EditConferenceViewSpec to javascript
With two files and only one small spec in coffeescript, this commit unifies everything under just the javascript version and removes the coffeescript. Change-Id: I4b4dd43a10e297ab79d0d6c39450d5ea12c5cf6f Reviewed-on: https://gerrit.instructure.com/86358 Tested-by: Jenkins Reviewed-by: Matthew Sessions <msessions@instructure.com> Product-Review: Clay Diffrient <cdiffrient@instructure.com> QA-Review: Clay Diffrient <cdiffrient@instructure.com>
1 parent 37fddd1 commit 70a52f5

2 files changed

Lines changed: 20 additions & 31 deletions

File tree

spec/coffeescripts/views/conferences/EditConferenceViewSpec.coffee

Lines changed: 0 additions & 29 deletions
This file was deleted.

spec/javascripts/jsx/conferences/EditConferenceViewSpec.jsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
11
define([
22
'compiled/views/conferences/EditConferenceView',
33
'compiled/models/Conference',
4+
'timezone',
5+
'vendor/timezone/fr_FR',
6+
'helpers/I18nStubber',
47
'helpers/fakeENV'
5-
], (EditConferenceView, Conference, fakeENV) => {
8+
], (EditConferenceView, Conference, tz, french, I18nStubber, fakeENV) => {
69
module('EditConferenceView', {
710
setup () {
811
this.view = new EditConferenceView();
9-
fakeENV.setup({conference_type_details: []});
12+
this.snapshot = tz.snapshot();
13+
this.datepickerSetting = {field: 'datepickerSetting', type: 'date_picker'};
14+
fakeENV.setup({conference_type_details: [{settings: [this.datepickerSetting]}]})
1015
},
1116
teardown () {
1217
fakeENV.teardown();
18+
tz.restore(this.snapshot);
1319
}
1420
});
1521

22+
test('updateConferenceUserSettingDetailsForConference localizes values for datepicker settings', function () {
23+
tz.changeLocale(french, 'fr_FR', 'fr');
24+
I18nStubber.pushFrame();
25+
I18nStubber.setLocale('fr_FR');
26+
I18nStubber.stub('fr_FR', {'date.formats.full_with_weekday': '%a %-d %b, %Y %-k:%M'});
27+
28+
const conferenceData = {user_settings: {datepickerSetting: '2015-08-07T17:00:00Z'}};
29+
this.view.updateConferenceUserSettingDetailsForConference(conferenceData);
30+
equal(this.datepickerSetting.value, 'ven. 7 août, 2015 17:00');
31+
I18nStubber.popFrame();
32+
});
33+
1634
test('#show sets the proper title for new conferences', function () {
1735
const expectedTitle = 'New Conference';
1836
const attributes = {

0 commit comments

Comments
 (0)