Skip to content

Commit 0b805f1

Browse files
committed
Fix test
1 parent 3862d3b commit 0b805f1

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

src/angular.spec.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff 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(/strictdi/);
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);

src/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)