File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,11 @@ describe('OC.L10N tests', function() {
110110 } ) ;
111111 } ) ;
112112 describe ( 'async loading of translations' , function ( ) {
113+ afterEach ( ( ) => {
114+ document . documentElement . removeAttribute ( 'data-locale' )
115+ } )
113116 it ( 'loads bundle for given app and calls callback' , function ( done ) {
114- var localeStub = sinon . stub ( OC , 'getLocale' ) . returns ( ' zh_CN') ;
117+ document . documentElement . setAttribute ( 'data-locale' , 'zh_CN' )
115118 var callbackStub = sinon . stub ( ) ;
116119 var promiseStub = sinon . stub ( ) ;
117120 var loading = OC . L10N . load ( TEST_APP , callbackStub ) ;
@@ -129,9 +132,9 @@ describe('OC.L10N tests', function() {
129132 expect ( callbackStub . calledOnce ) . toEqual ( true ) ;
130133 expect ( promiseStub . calledOnce ) . toEqual ( true ) ;
131134 expect ( t ( TEST_APP , 'Hello world!' ) ) . toEqual ( '你好世界!' ) ;
132- localeStub . restore ( ) ;
133135 } )
134- . then ( done ) ;
136+ . then ( done )
137+ . catch ( e => expect ( e ) . toBe ( 'No error expected!' ) ) ;
135138
136139 expect ( promiseStub . notCalled ) . toEqual ( true ) ;
137140 req . respond (
You can’t perform that action at this time.
0 commit comments