Fix 'gr-date-formatter' tests in Edge
Bug: Issue 3999 Change-Id: I77df1cfb1c87cb02ac72293b45b3d00c7f59273e
This commit is contained in:
@@ -37,11 +37,12 @@
|
||||
},
|
||||
|
||||
_timeFormat: String,
|
||||
_timeFormatPromise: Object, // Used for testing.
|
||||
},
|
||||
|
||||
attached: function() {
|
||||
this._getTimeFormat().then(function(timeFormat) {
|
||||
this._timeFormat = timeFormat;
|
||||
this._timeFormatPromise = this._getTimeFormat().then(function(tf) {
|
||||
this._timeFormat = tf;
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
|
@@ -129,14 +129,15 @@ limitations under the License.
|
||||
}
|
||||
|
||||
suite('logged in', function() {
|
||||
setup(function() {
|
||||
setup(function(done) {
|
||||
return stubRestAPI(true, {time_format: 'HHMM_12'}).then(function() {
|
||||
element = fixture('basic');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('Preferences are respected', function(done) {
|
||||
flush(function() {
|
||||
element._timeFormatPromise.then(function() {
|
||||
assert.equal(element._timeFormat, 'HHMM_12');
|
||||
done();
|
||||
});
|
||||
@@ -144,14 +145,15 @@ limitations under the License.
|
||||
});
|
||||
|
||||
suite('logged out', function() {
|
||||
setup(function() {
|
||||
setup(function(done) {
|
||||
return stubRestAPI(false, null).then(function() {
|
||||
element = fixture('basic');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('Default preferences are respected', function(done) {
|
||||
flush(function() {
|
||||
element._timeFormatPromise.then(function() {
|
||||
assert.equal(element._timeFormat, 'HHMM_24');
|
||||
done();
|
||||
});
|
||||
|
Reference in New Issue
Block a user