File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -108,9 +108,29 @@ describe("angular", () => {
108108 dealoc ( document ) ;
109109 } ) ;
110110
111- it ( "should bootstrap in strict mode when ng- strict-di attribute is specified" , ( ) => {
111+ it ( "should bootstrap in strict mode when strict-di attribute is specified" , ( ) => {
112112 const appElement = createElementFromHTML (
113- '<div ng-app="" ng-strict-di></div>' ,
113+ '<div ng-app="" strict-di></div>' ,
114+ ) ;
115+ const root = createElementFromHTML ( "<div></div>" ) ;
116+ root . append ( appElement ) ;
117+
118+ window . angular . init ( root ) ;
119+ expect ( bootstrapSpy ) . toHaveBeenCalled ( ) ;
120+ expect ( bootstrapSpy . calls . mostRecent ( ) . args [ 2 ] . strictDi ) . toBe ( true ) ;
121+
122+ const injector = angular . getInjector ( appElement ) ;
123+ function testFactory ( $rootScope ) { }
124+ expect ( ( ) => {
125+ injector . instantiate ( testFactory ) ;
126+ } ) . toThrowError ( / s t r i c t d i / ) ;
127+
128+ dealoc ( appElement ) ;
129+ } ) ;
130+
131+ it ( "should bootstrap in strict mode when strict-di data attribute is specified" , ( ) => {
132+ const appElement = createElementFromHTML (
133+ '<div data-ng-app="" data-strict-di></div>' ,
114134 ) ;
115135 const root = createElementFromHTML ( "<div></div>" ) ;
116136 root . append ( appElement ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ describe("index", () => {
66 } ) ;
77
88 it ( "initializes ng modules" , async ( ) => {
9- expect ( angular . bootsrappedModules [ 0 ] ) . toEqual ( "ng" ) ;
9+ expect ( angular . _bootsrappedModules [ 0 ] ) . toEqual ( "ng" ) ;
1010 } ) ;
1111} ) ;
You can’t perform that action at this time.
0 commit comments