@@ -18,7 +18,7 @@ import { FirebaseApp } from '@firebase/app-types';
1818import { expect } from 'chai' ;
1919import * as sinon from 'sinon' ;
2020
21- import { ControllerInterface } from '../src/controllers/controller-interface ' ;
21+ import { BaseController } from '../src/controllers/base-controller ' ;
2222import { SwController } from '../src/controllers/sw-controller' ;
2323import { WindowController } from '../src/controllers/window-controller' ;
2424import { DEFAULT_PUBLIC_VAPID_KEY } from '../src/models/fcm-details' ;
@@ -34,10 +34,10 @@ import { describe } from './testing-utils/messaging-test-runner';
3434const controllersToTest = [ WindowController , SwController ] ;
3535
3636/**
37- * As ControllerInterface is an abstract class, we need a concrete
37+ * As BaseController is an abstract class, we need a concrete
3838 * implementation that can be initialized for testing
3939 */
40- class MockControllerInterface extends ControllerInterface {
40+ class MockBaseController extends BaseController {
4141 async getSWRegistration_ ( ) : Promise < ServiceWorkerRegistration > {
4242 return new ServiceWorkerRegistration ( ) ;
4343 }
@@ -47,7 +47,7 @@ class MockControllerInterface extends ControllerInterface {
4747 }
4848}
4949
50- describe ( 'Firebase Messaging > *ControllerInterface ' , ( ) => {
50+ describe ( 'Firebase Messaging > *BaseController ' , ( ) => {
5151 let sandbox : sinon . SinonSandbox ;
5252 let app : FirebaseApp ;
5353
@@ -64,7 +64,7 @@ describe('Firebase Messaging > *ControllerInterface', () => {
6464
6565 describe ( 'INTERNAL.delete()' , ( ) => {
6666 it ( 'should call delete()' , ( ) => {
67- const controller = new MockControllerInterface ( app ) ;
67+ const controller = new MockBaseController ( app ) ;
6868 const spy = sandbox . spy ( controller , 'delete' ) ;
6969 controller . INTERNAL . delete ( ) ;
7070 expect ( spy . callCount ) . to . equal ( 1 ) ;
@@ -73,7 +73,7 @@ describe('Firebase Messaging > *ControllerInterface', () => {
7373
7474 describe ( 'requestPermission()' , ( ) => {
7575 it ( `should throw` , ( ) => {
76- const controller = new MockControllerInterface ( app ) ;
76+ const controller = new MockBaseController ( app ) ;
7777 let thrownError ;
7878 try {
7979 controller . requestPermission ( ) ;
@@ -151,7 +151,7 @@ describe('Firebase Messaging > *ControllerInterface', () => {
151151
152152 describe ( 'useServiceWorker()' , ( ) => {
153153 it ( `should throw` , ( ) => {
154- const controller = new MockControllerInterface ( app ) ;
154+ const controller = new MockBaseController ( app ) ;
155155 let thrownError ;
156156 try {
157157 controller . useServiceWorker ( null as any ) ;
@@ -165,7 +165,7 @@ describe('Firebase Messaging > *ControllerInterface', () => {
165165
166166 describe ( 'usePublicVapidKey()' , ( ) => {
167167 it ( `should throw` , ( ) => {
168- const controller = new MockControllerInterface ( app ) ;
168+ const controller = new MockBaseController ( app ) ;
169169 let thrownError ;
170170 try {
171171 controller . usePublicVapidKey ( null as any ) ;
@@ -179,7 +179,7 @@ describe('Firebase Messaging > *ControllerInterface', () => {
179179
180180 describe ( 'onMessage()' , ( ) => {
181181 it ( `should throw` , ( ) => {
182- const controller = new MockControllerInterface ( app ) ;
182+ const controller = new MockBaseController ( app ) ;
183183 let thrownError ;
184184 try {
185185 controller . onMessage ( null as any , null as any , null as any ) ;
@@ -193,7 +193,7 @@ describe('Firebase Messaging > *ControllerInterface', () => {
193193
194194 describe ( 'onTokenRefresh()' , ( ) => {
195195 it ( `should throw` , ( ) => {
196- const controller = new MockControllerInterface ( app ) ;
196+ const controller = new MockBaseController ( app ) ;
197197 let thrownError ;
198198 try {
199199 controller . onTokenRefresh ( null as any , null as any , null as any ) ;
@@ -207,7 +207,7 @@ describe('Firebase Messaging > *ControllerInterface', () => {
207207
208208 describe ( 'setBackgroundMessageHandler()' , ( ) => {
209209 it ( `should throw` , ( ) => {
210- const controller = new MockControllerInterface ( app ) ;
210+ const controller = new MockBaseController ( app ) ;
211211 let thrownError ;
212212 try {
213213 controller . setBackgroundMessageHandler ( null as any ) ;
@@ -222,31 +222,31 @@ describe('Firebase Messaging > *ControllerInterface', () => {
222222 describe ( 'getNotificationPermission_' , ( ) => {
223223 it ( 'should return current permission' , ( ) => {
224224 sandbox . stub ( Notification as any , 'permission' ) . value ( 'test' ) ;
225- const controller = new MockControllerInterface ( app ) ;
225+ const controller = new MockBaseController ( app ) ;
226226 const result = controller . getNotificationPermission_ ( ) ;
227227 expect ( result ) . to . equal ( 'test' ) ;
228228 } ) ;
229229 } ) ;
230230
231231 describe ( 'getTokenDetailsModel' , ( ) => {
232232 it ( 'should return an instance of TokenDetailsModel' , ( ) => {
233- const controller = new MockControllerInterface ( app ) ;
233+ const controller = new MockBaseController ( app ) ;
234234 const result = controller . getTokenDetailsModel ( ) ;
235235 expect ( result ) . to . be . instanceof ( TokenDetailsModel ) ;
236236 } ) ;
237237 } ) ;
238238
239239 describe ( 'getVapidDetailsModel' , ( ) => {
240240 it ( 'should return an instance of VapidDetailsModel' , ( ) => {
241- const controller = new MockControllerInterface ( app ) ;
241+ const controller = new MockBaseController ( app ) ;
242242 const result = controller . getVapidDetailsModel ( ) ;
243243 expect ( result ) . to . be . instanceof ( VapidDetailsModel ) ;
244244 } ) ;
245245 } ) ;
246246
247247 describe ( 'getIidModel' , ( ) => {
248248 it ( 'should return an instance of IidModel' , ( ) => {
249- const controller = new MockControllerInterface ( app ) ;
249+ const controller = new MockBaseController ( app ) ;
250250 const result = controller . getIidModel ( ) ;
251251 expect ( result ) . to . be . instanceof ( IidModel ) ;
252252 } ) ;
0 commit comments