@angular-wave/angular.ts 0.0.25 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/dist/angular-ts.esm.js +1 -1
- package/dist/angular-ts.umd.js +1 -1
- package/index.html +4 -4
- package/legacy/angular.js +6 -6
- package/package.json +1 -1
- package/src/core/compile.md +2 -2
- package/src/directive/cloak.md +2 -2
- package/src/directive/repeat.md +1 -1
- package/src/router/globals.js +0 -5
- package/src/router/params/param-types.js +0 -3
- package/src/router/router.js +5 -53
- package/src/router/services.js +2 -4
- package/src/router/state/state-queue-manager.js +0 -3
- package/src/router/state/state-registry.js +0 -5
- package/src/router/state/state-service.js +0 -4
- package/src/router/transition/transition-hook.js +1 -8
- package/src/router/transition/transition-service.js +0 -12
- package/src/router/url/url-config.js +7 -7
- package/src/router/url/url-router.js +1 -1
- package/src/router/url/url-rules.js +0 -4
- package/src/router/url/url-service.js +113 -80
- package/src/shared/utils.js +1 -1
- package/test/angular.spec.js +4 -4
- package/test/core/compile.spec.js +9 -9
- package/test/core/interval.spec.js +1 -1
- package/test/core/on.spec.js +2 -2
- package/test/core/prop.spec.js +2 -2
- package/test/directive/ref.spec.js +1 -1
- package/test/router/state-directives.spec.js +72 -72
- package/test/router/state.spec.js +12 -8
- package/test/router/template-factory.spec.js +2 -2
- package/test/router/view-directive.spec.js +65 -65
- package/test/router/view-hook.spec.js +11 -11
- package/test/router/view-scroll.spec.js +2 -2
- package/test/router/view.spec.js +1 -1
- package/src/router/location-services.js +0 -67
|
@@ -187,7 +187,7 @@ describe("uiView", () => {
|
|
|
187
187
|
expect(elem.find("ui-view").text()).toBe("");
|
|
188
188
|
|
|
189
189
|
$state.transitionTo(aState);
|
|
190
|
-
await wait(
|
|
190
|
+
await wait(100);
|
|
191
191
|
|
|
192
192
|
expect(elem.find("ui-view").text()).toBe(aState.template);
|
|
193
193
|
});
|
|
@@ -198,7 +198,7 @@ describe("uiView", () => {
|
|
|
198
198
|
);
|
|
199
199
|
|
|
200
200
|
$state.transitionTo(cState);
|
|
201
|
-
await wait(
|
|
201
|
+
await wait(100);
|
|
202
202
|
|
|
203
203
|
expect(elem.find("ui-view").text()).toBe(cState.views.cview.template);
|
|
204
204
|
});
|
|
@@ -208,12 +208,12 @@ describe("uiView", () => {
|
|
|
208
208
|
expect(elem.find("ui-view").text()).toBe("");
|
|
209
209
|
|
|
210
210
|
$state.transitionTo(aState);
|
|
211
|
-
await wait(
|
|
211
|
+
await wait(100);
|
|
212
212
|
|
|
213
213
|
expect(elem.find("ui-view").text()).toBe(aState.template);
|
|
214
214
|
|
|
215
215
|
$state.transitionTo(bState);
|
|
216
|
-
await wait(
|
|
216
|
+
await wait(100);
|
|
217
217
|
|
|
218
218
|
expect(elem.find("ui-view").text()).toBe(bState.template);
|
|
219
219
|
});
|
|
@@ -228,7 +228,7 @@ describe("uiView", () => {
|
|
|
228
228
|
expect(elem.find("ui-view").eq(1).text()).toBe("");
|
|
229
229
|
|
|
230
230
|
$state.transitionTo(dState);
|
|
231
|
-
await wait(
|
|
231
|
+
await wait(100);
|
|
232
232
|
|
|
233
233
|
expect(elem.find("ui-view").eq(0).text()).toBe(
|
|
234
234
|
dState.views.dview1.template,
|
|
@@ -243,7 +243,7 @@ describe("uiView", () => {
|
|
|
243
243
|
expect(elem.find("ui-view").text()).toBe("");
|
|
244
244
|
|
|
245
245
|
$state.transitionTo(fState);
|
|
246
|
-
await wait(
|
|
246
|
+
await wait(100);
|
|
247
247
|
|
|
248
248
|
expect(elem.find("ui-view").text()).toBe(fState.views.eview.template);
|
|
249
249
|
});
|
|
@@ -256,7 +256,7 @@ describe("uiView", () => {
|
|
|
256
256
|
elem.append($compile("<div><ui-view></ui-view></div>")(scope));
|
|
257
257
|
|
|
258
258
|
$state.transitionTo(gState);
|
|
259
|
-
await wait(
|
|
259
|
+
await wait(100);
|
|
260
260
|
|
|
261
261
|
expect(elem.find("ui-view").text()).toBe(content);
|
|
262
262
|
});
|
|
@@ -267,13 +267,13 @@ describe("uiView", () => {
|
|
|
267
267
|
elem.append($compile("<div><ui-view></ui-view></div>")(scope));
|
|
268
268
|
|
|
269
269
|
$state.go(hState);
|
|
270
|
-
await wait(
|
|
270
|
+
await wait(100);
|
|
271
271
|
|
|
272
272
|
expect(elem.find("ui-view").text()).toBe(hState.views.inner.template);
|
|
273
273
|
|
|
274
274
|
// going to the parent state which makes the inner view empty
|
|
275
275
|
$state.go(gState);
|
|
276
|
-
await wait(
|
|
276
|
+
await wait(100);
|
|
277
277
|
|
|
278
278
|
expect(elem.find("ui-view").text()).toBe(content);
|
|
279
279
|
});
|
|
@@ -286,20 +286,20 @@ describe("uiView", () => {
|
|
|
286
286
|
|
|
287
287
|
// transition to state that has an initial view
|
|
288
288
|
$state.transitionTo(iState);
|
|
289
|
-
await wait(
|
|
289
|
+
await wait(100);
|
|
290
290
|
|
|
291
291
|
// verify if ng-repeat has been compiled
|
|
292
292
|
expect(elem.find("li").length).toBe(scope.items.length);
|
|
293
293
|
|
|
294
294
|
// transition to another state that replace the initial content
|
|
295
295
|
$state.transitionTo(jState);
|
|
296
|
-
await wait(
|
|
296
|
+
await wait(100);
|
|
297
297
|
|
|
298
298
|
expect(elem.find("ui-view").text()).toBe(jState.template);
|
|
299
299
|
|
|
300
300
|
// transition back to the state with empty subview and the initial view
|
|
301
301
|
$state.transitionTo(iState);
|
|
302
|
-
await wait(
|
|
302
|
+
await wait(100);
|
|
303
303
|
|
|
304
304
|
// verify if the initial view is correct
|
|
305
305
|
expect(elem.find("li").length).toBe(scope.items.length);
|
|
@@ -319,7 +319,7 @@ describe("uiView", () => {
|
|
|
319
319
|
elem.append($compile("<div><ui-view></ui-view></div>")(scope));
|
|
320
320
|
|
|
321
321
|
$state.transitionTo(aState);
|
|
322
|
-
await wait(
|
|
322
|
+
await wait(100);
|
|
323
323
|
expect($uiViewScroll).not.toHaveBeenCalled();
|
|
324
324
|
});
|
|
325
325
|
|
|
@@ -341,7 +341,7 @@ describe("uiView", () => {
|
|
|
341
341
|
);
|
|
342
342
|
|
|
343
343
|
$state.transitionTo(aState);
|
|
344
|
-
await wait(
|
|
344
|
+
await wait(100);
|
|
345
345
|
|
|
346
346
|
expect($uiViewScroll).not.toHaveBeenCalled();
|
|
347
347
|
|
|
@@ -375,7 +375,7 @@ describe("uiView", () => {
|
|
|
375
375
|
),
|
|
376
376
|
);
|
|
377
377
|
$state.transitionTo(mState);
|
|
378
|
-
await wait(
|
|
378
|
+
await wait(100);
|
|
379
379
|
|
|
380
380
|
expect(elem.text()).toBe("mState");
|
|
381
381
|
});
|
|
@@ -428,7 +428,7 @@ describe("uiView", () => {
|
|
|
428
428
|
elem.append($compile("<div><ui-view></ui-view></div>")(scope));
|
|
429
429
|
|
|
430
430
|
await $state.transitionTo("resolve");
|
|
431
|
-
await wait(
|
|
431
|
+
await wait(100);
|
|
432
432
|
|
|
433
433
|
expect(elem.text()).toBe("joeschmoe");
|
|
434
434
|
expect(_scope.$resolve).toBeDefined();
|
|
@@ -445,7 +445,7 @@ describe("uiView", () => {
|
|
|
445
445
|
expect(elem.text()).toBe("");
|
|
446
446
|
|
|
447
447
|
await $state.transitionTo("resolve");
|
|
448
|
-
await wait(
|
|
448
|
+
await wait(100);
|
|
449
449
|
|
|
450
450
|
expect(elem.text()).toBe("joeschmoe");
|
|
451
451
|
});
|
|
@@ -460,7 +460,7 @@ describe("uiView", () => {
|
|
|
460
460
|
elem.append($compile("<div><ui-view></ui-view></div>")(scope));
|
|
461
461
|
|
|
462
462
|
await $state.transitionTo("resolve");
|
|
463
|
-
await wait(
|
|
463
|
+
await wait(100);
|
|
464
464
|
|
|
465
465
|
expect(elem.text()).toBe("joeschmoe");
|
|
466
466
|
expect(_scope.$$$resolve).toBeDefined();
|
|
@@ -495,7 +495,7 @@ describe("uiView", () => {
|
|
|
495
495
|
});
|
|
496
496
|
elem.append($compile("<div><ui-view></ui-view></div>")(scope));
|
|
497
497
|
await $state.transitionTo("onInit");
|
|
498
|
-
await wait(
|
|
498
|
+
await wait(100);
|
|
499
499
|
|
|
500
500
|
expect($onInit).toHaveBeenCalled();
|
|
501
501
|
});
|
|
@@ -506,7 +506,7 @@ describe("uiView", () => {
|
|
|
506
506
|
$stateProvider.state({ name: "abstract.foo", template: "hello" });
|
|
507
507
|
elem.append($compile("<div><ui-view></ui-view></div>")(scope));
|
|
508
508
|
$state.transitionTo("abstract.foo");
|
|
509
|
-
await wait(
|
|
509
|
+
await wait(100);
|
|
510
510
|
|
|
511
511
|
expect(elem.text()).toBe("hello");
|
|
512
512
|
});
|
|
@@ -520,7 +520,7 @@ describe("uiView", () => {
|
|
|
520
520
|
);
|
|
521
521
|
|
|
522
522
|
$state.transitionTo(aState);
|
|
523
|
-
await wait(
|
|
523
|
+
await wait(100);
|
|
524
524
|
|
|
525
525
|
// Verify there is no ui-view in the DOM
|
|
526
526
|
expect(elem.find("ui-view").length).toBe(0);
|
|
@@ -612,7 +612,7 @@ describe("uiView", () => {
|
|
|
612
612
|
);
|
|
613
613
|
|
|
614
614
|
$state.transitionTo(lState);
|
|
615
|
-
await wait(
|
|
615
|
+
await wait(100);
|
|
616
616
|
|
|
617
617
|
expect(elem.find("ui-view").length).toBe(0);
|
|
618
618
|
|
|
@@ -646,7 +646,7 @@ describe("uiView", () => {
|
|
|
646
646
|
);
|
|
647
647
|
|
|
648
648
|
$state.transitionTo(lState);
|
|
649
|
-
await wait(
|
|
649
|
+
await wait(100);
|
|
650
650
|
|
|
651
651
|
expect(elem.find("ui-view").length).toBe(0);
|
|
652
652
|
|
|
@@ -686,7 +686,7 @@ describe("uiView", () => {
|
|
|
686
686
|
// expect(animation.element.text() + "-1").toBe(content + "-1");
|
|
687
687
|
|
|
688
688
|
// $state.transitionTo(aState);
|
|
689
|
-
// await wait(
|
|
689
|
+
// await wait(100);
|
|
690
690
|
|
|
691
691
|
// // Enter Animation
|
|
692
692
|
// animation = $animate.queue.shift();
|
|
@@ -698,7 +698,7 @@ describe("uiView", () => {
|
|
|
698
698
|
// expect(animation.element.text() + "-3").toBe(content + "-3");
|
|
699
699
|
|
|
700
700
|
// $state.transitionTo(bState);
|
|
701
|
-
// await wait(
|
|
701
|
+
// await wait(100);
|
|
702
702
|
|
|
703
703
|
// // Enter Animation
|
|
704
704
|
// animation = $animate.queue.shift();
|
|
@@ -802,24 +802,24 @@ describe("uiView", () => {
|
|
|
802
802
|
// $compile("<div><ui-view>" + content + "</ui-view></div>")(scope),
|
|
803
803
|
// );
|
|
804
804
|
// $state.transitionTo("n");
|
|
805
|
-
// await wait(
|
|
805
|
+
// await wait(100);
|
|
806
806
|
|
|
807
807
|
// expect($state.current.name).toBe("n");
|
|
808
808
|
// expect(log).toBe("start:n;finish:n;success:n;");
|
|
809
809
|
|
|
810
810
|
// // animateFlush($animate);
|
|
811
|
-
// await wait(
|
|
811
|
+
// await wait(100);
|
|
812
812
|
// expect(log).toBe("start:n;finish:n;success:n;animEnter;");
|
|
813
813
|
|
|
814
814
|
// $state.transitionTo("a");
|
|
815
|
-
// await wait(
|
|
815
|
+
// await wait(100);
|
|
816
816
|
// expect($state.current.name).toBe("a");
|
|
817
817
|
// expect(log).toBe(
|
|
818
818
|
// "start:n;finish:n;success:n;animEnter;start:a;finish:a;destroy;success:a;",
|
|
819
819
|
// );
|
|
820
820
|
|
|
821
821
|
// // animateFlush($animate);
|
|
822
|
-
// await wait(
|
|
822
|
+
// await wait(100);
|
|
823
823
|
// expect(log).toBe(
|
|
824
824
|
// "start:n;finish:n;success:n;animEnter;start:a;finish:a;destroy;success:a;animLeave;",
|
|
825
825
|
// );
|
|
@@ -891,7 +891,7 @@ describe("UiView", () => {
|
|
|
891
891
|
);
|
|
892
892
|
|
|
893
893
|
await $state.go("main.home");
|
|
894
|
-
await wait(
|
|
894
|
+
await wait(100);
|
|
895
895
|
|
|
896
896
|
expect($state.current.name).toBe("main.home");
|
|
897
897
|
});
|
|
@@ -911,7 +911,7 @@ describe("UiView", () => {
|
|
|
911
911
|
const el = $compile(tpl)($rootScope);
|
|
912
912
|
|
|
913
913
|
$state.go("test");
|
|
914
|
-
await wait(
|
|
914
|
+
await wait(100);
|
|
915
915
|
|
|
916
916
|
expect($state.current.name).toBe("test");
|
|
917
917
|
expect(el.text().replace(/\s*/g, "")).toBe("MAIN-DEFAULT-TEST");
|
|
@@ -978,7 +978,7 @@ describe("uiView transclusion", () => {
|
|
|
978
978
|
});
|
|
979
979
|
elem.append($compile("<div><ui-view></ui-view></div>")(scope));
|
|
980
980
|
$state.transitionTo("a.b");
|
|
981
|
-
await wait(
|
|
981
|
+
await wait(100);
|
|
982
982
|
expect(aliveCount).toBe(0);
|
|
983
983
|
});
|
|
984
984
|
});
|
|
@@ -1053,17 +1053,17 @@ describe("uiView controllers or onEnter handlers", () => {
|
|
|
1053
1053
|
$rootScope.$digest();
|
|
1054
1054
|
|
|
1055
1055
|
await $state.transitionTo("aside");
|
|
1056
|
-
await wait(
|
|
1056
|
+
await wait(100);
|
|
1057
1057
|
expect(template[0].querySelector(".aside")).toBeDefined();
|
|
1058
1058
|
expect(template[0].querySelector(".fwd")).toBeNull();
|
|
1059
1059
|
|
|
1060
1060
|
await $state.transitionTo("A");
|
|
1061
|
-
await wait(
|
|
1061
|
+
await wait(100);
|
|
1062
1062
|
expect(template[0].querySelector(".A")).not.toBeNull();
|
|
1063
1063
|
expect(template[0].querySelector(".fwd")).toBeNull();
|
|
1064
1064
|
|
|
1065
1065
|
await $state.transitionTo("A.fwd");
|
|
1066
|
-
await wait(
|
|
1066
|
+
await wait(100);
|
|
1067
1067
|
expect(template[0].querySelector(".A")).not.toBeNull();
|
|
1068
1068
|
expect(template[0].querySelector(".fwd")).not.toBeNull();
|
|
1069
1069
|
expect(template[0].querySelector(".nest")).not.toBeNull();
|
|
@@ -1246,7 +1246,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1246
1246
|
$templateCache.put("/comp_tpl.html", "-{{ $ctrl.data }}-");
|
|
1247
1247
|
|
|
1248
1248
|
await $state.transitionTo("cmp_tpl");
|
|
1249
|
-
await wait(
|
|
1249
|
+
await wait(100);
|
|
1250
1250
|
|
|
1251
1251
|
expect($state.current.name).toBe("cmp_tpl");
|
|
1252
1252
|
expect(el[0].querySelector("ui-view").innerHTML).toEqual(
|
|
@@ -1264,7 +1264,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1264
1264
|
$templateCache.put("/comp_tpl.html", "-{{ $ctrl.data }}-");
|
|
1265
1265
|
|
|
1266
1266
|
$state.transitionTo("cmp_tpl");
|
|
1267
|
-
await wait(
|
|
1267
|
+
await wait(100);
|
|
1268
1268
|
|
|
1269
1269
|
expect($state.current.name).toBe("cmp_tpl");
|
|
1270
1270
|
expect(el[0].querySelector("ui-view").innerHTML).toEqual(
|
|
@@ -1350,7 +1350,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1350
1350
|
|
|
1351
1351
|
$templateCache.put("/comp_tpl.html", "-{{ $ctrl.data }}-");
|
|
1352
1352
|
$state.transitionTo("route2cmp");
|
|
1353
|
-
await wait(
|
|
1353
|
+
await wait(100);
|
|
1354
1354
|
|
|
1355
1355
|
const directiveEl = el[0].querySelector("div ui-view ng12-directive");
|
|
1356
1356
|
expect(directiveEl).toBeDefined();
|
|
@@ -1376,7 +1376,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1376
1376
|
|
|
1377
1377
|
$templateCache.put("/comp_tpl.html", "-{{ $ctrl.data }}-");
|
|
1378
1378
|
$state.transitionTo("route2cmp");
|
|
1379
|
-
await wait(
|
|
1379
|
+
await wait(100);
|
|
1380
1380
|
|
|
1381
1381
|
const directiveEl = el[0].querySelector("div ui-view ng13-directive");
|
|
1382
1382
|
expect(directiveEl).toBeDefined();
|
|
@@ -1400,7 +1400,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1400
1400
|
|
|
1401
1401
|
$templateCache.put("/comp_tpl.html", "-{{ $ctrl.data }}-");
|
|
1402
1402
|
$state.transitionTo("route2cmp");
|
|
1403
|
-
await wait(
|
|
1403
|
+
await wait(100);
|
|
1404
1404
|
|
|
1405
1405
|
expect(log).toBe("onInit;");
|
|
1406
1406
|
});
|
|
@@ -1423,7 +1423,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1423
1423
|
|
|
1424
1424
|
$templateCache.put("/comp_tpl.html", "-{{ $ctrl.data }}-");
|
|
1425
1425
|
$state.transitionTo("route2cmp");
|
|
1426
|
-
await wait(
|
|
1426
|
+
await wait(100);
|
|
1427
1427
|
|
|
1428
1428
|
const directiveEl = el[0].querySelector("div ui-view ng-component");
|
|
1429
1429
|
expect(directiveEl).toBeDefined();
|
|
@@ -1448,7 +1448,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1448
1448
|
|
|
1449
1449
|
$templateCache.put("/comp_tpl.html", "-{{ $ctrl.data }}-");
|
|
1450
1450
|
$state.transitionTo("route2cmp");
|
|
1451
|
-
await wait(
|
|
1451
|
+
await wait(100);
|
|
1452
1452
|
|
|
1453
1453
|
expect(log).toBe("onInit;");
|
|
1454
1454
|
});
|
|
@@ -1470,7 +1470,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1470
1470
|
|
|
1471
1471
|
$templateCache.put("/comp_tpl.html", "-{{ $ctrl.data }}-");
|
|
1472
1472
|
$state.transitionTo("route2cmp");
|
|
1473
|
-
await wait(
|
|
1473
|
+
await wait(100);
|
|
1474
1474
|
|
|
1475
1475
|
expect(log).toBe("onInit;");
|
|
1476
1476
|
});
|
|
@@ -1498,7 +1498,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1498
1498
|
$q = svcs.$q;
|
|
1499
1499
|
|
|
1500
1500
|
$state.transitionTo("bindingtypes");
|
|
1501
|
-
await wait(
|
|
1501
|
+
await wait(100);
|
|
1502
1502
|
|
|
1503
1503
|
expect(el.text()).toBe("-ONEWAY,TWOWAY,ATTRIBUTE-");
|
|
1504
1504
|
});
|
|
@@ -1524,7 +1524,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1524
1524
|
const $state = svcs.$state;
|
|
1525
1525
|
|
|
1526
1526
|
$state.transitionTo("optionalbindingtypes");
|
|
1527
|
-
await wait(
|
|
1527
|
+
await wait(100);
|
|
1528
1528
|
|
|
1529
1529
|
expect(el.text()).toBe("-ONEWAY,TWOWAY,ATTRIBUTE-");
|
|
1530
1530
|
});
|
|
@@ -1538,7 +1538,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1538
1538
|
|
|
1539
1539
|
const $state = svcs.$state;
|
|
1540
1540
|
$state.transitionTo("nothrow");
|
|
1541
|
-
await wait(
|
|
1541
|
+
await wait(100);
|
|
1542
1542
|
|
|
1543
1543
|
expect(el.text()).toBe("eventCmp");
|
|
1544
1544
|
});
|
|
@@ -1553,7 +1553,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1553
1553
|
const $state = svcs.$state,
|
|
1554
1554
|
$q = svcs.$q;
|
|
1555
1555
|
$state.transitionTo("data");
|
|
1556
|
-
await wait(
|
|
1556
|
+
await wait(100);
|
|
1557
1557
|
|
|
1558
1558
|
expect(el.text()).toBe("DataComponent");
|
|
1559
1559
|
});
|
|
@@ -1569,7 +1569,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1569
1569
|
const $state = svcs.$state,
|
|
1570
1570
|
$q = svcs.$q;
|
|
1571
1571
|
$state.transitionTo("data");
|
|
1572
|
-
await wait(
|
|
1572
|
+
await wait(100);
|
|
1573
1573
|
|
|
1574
1574
|
expect(el.text()).toBe("-user-");
|
|
1575
1575
|
});
|
|
@@ -1595,7 +1595,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1595
1595
|
});
|
|
1596
1596
|
|
|
1597
1597
|
$state.transitionTo("parent.child");
|
|
1598
|
-
await wait(
|
|
1598
|
+
await wait(100);
|
|
1599
1599
|
expect(el.text()).toEqual("-1w,2w,attrval-");
|
|
1600
1600
|
});
|
|
1601
1601
|
|
|
@@ -1625,7 +1625,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1625
1625
|
});
|
|
1626
1626
|
|
|
1627
1627
|
$state.transitionTo("parent.child");
|
|
1628
|
-
await wait(
|
|
1628
|
+
await wait(100);
|
|
1629
1629
|
expect(el.text()).toEqual("-1w,2w,attrval-");
|
|
1630
1630
|
});
|
|
1631
1631
|
|
|
@@ -1656,7 +1656,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1656
1656
|
});
|
|
1657
1657
|
|
|
1658
1658
|
$state.transitionTo("parent.child");
|
|
1659
|
-
await wait(
|
|
1659
|
+
await wait(100);
|
|
1660
1660
|
expect(el.text()).toEqual("-asfasfd,2w,attrval-");
|
|
1661
1661
|
});
|
|
1662
1662
|
|
|
@@ -1677,7 +1677,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1677
1677
|
});
|
|
1678
1678
|
|
|
1679
1679
|
$state.transitionTo("parent.child");
|
|
1680
|
-
await wait(
|
|
1680
|
+
await wait(100);
|
|
1681
1681
|
expect($rootScope.log).toEqual([]);
|
|
1682
1682
|
expect(
|
|
1683
1683
|
el
|
|
@@ -1712,7 +1712,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1712
1712
|
});
|
|
1713
1713
|
|
|
1714
1714
|
$state.transitionTo("resolve");
|
|
1715
|
-
await wait(
|
|
1715
|
+
await wait(100);
|
|
1716
1716
|
expect(log).toEqual([]);
|
|
1717
1717
|
el.find("button")[0].click();
|
|
1718
1718
|
expect(log).toEqual([123, 456]);
|
|
@@ -1740,7 +1740,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1740
1740
|
});
|
|
1741
1741
|
|
|
1742
1742
|
$state.transitionTo("resolve");
|
|
1743
|
-
await wait(
|
|
1743
|
+
await wait(100);
|
|
1744
1744
|
expect(log).toEqual([]);
|
|
1745
1745
|
el.find("button")[0].click();
|
|
1746
1746
|
expect(log).toEqual([123, 456]);
|
|
@@ -1790,7 +1790,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1790
1790
|
|
|
1791
1791
|
$templateCache.put("/comp_tpl.html", "-{{ $ctrl.data }}-");
|
|
1792
1792
|
$state.transitionTo("route2cmp");
|
|
1793
|
-
await wait(
|
|
1793
|
+
await wait(100);
|
|
1794
1794
|
|
|
1795
1795
|
const header = el[0].querySelector("[ui-view=header]");
|
|
1796
1796
|
const content = el[0].querySelector("[ui-view=content]");
|
|
@@ -1820,7 +1820,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1820
1820
|
|
|
1821
1821
|
$templateCache.put("/comp_tpl.html", "-{{ $ctrl.data }}-");
|
|
1822
1822
|
$state.transitionTo("route2cmp");
|
|
1823
|
-
await wait(
|
|
1823
|
+
await wait(100);
|
|
1824
1824
|
|
|
1825
1825
|
const header = el[0].querySelector("[ui-view=header]");
|
|
1826
1826
|
const content = el[0].querySelector("[ui-view=content]");
|
|
@@ -1862,7 +1862,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1862
1862
|
|
|
1863
1863
|
$templateCache.put("/comp_tpl.html", "-{{ $ctrl.data }}-");
|
|
1864
1864
|
$state.transitionTo("route2cmp");
|
|
1865
|
-
await wait(
|
|
1865
|
+
await wait(100);
|
|
1866
1866
|
|
|
1867
1867
|
const directiveEl = el[0].querySelector("div ui-view ng12-directive");
|
|
1868
1868
|
expect(directiveEl).toBeDefined();
|
|
@@ -1895,7 +1895,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1895
1895
|
"-{{ $ctrl.data }}.{{ $ctrl.data2 }}-",
|
|
1896
1896
|
);
|
|
1897
1897
|
$state.transitionTo("route2cmp");
|
|
1898
|
-
await wait(
|
|
1898
|
+
await wait(100);
|
|
1899
1899
|
|
|
1900
1900
|
const directiveEl = el[0].querySelector("div ui-view ng-component");
|
|
1901
1901
|
expect(directiveEl).toBeDefined();
|
|
@@ -1923,7 +1923,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1923
1923
|
$state.transitionTo("ng12-dynamic-directive", {
|
|
1924
1924
|
type: "ng12DynamicDirective",
|
|
1925
1925
|
});
|
|
1926
|
-
await wait(
|
|
1926
|
+
await wait(100);
|
|
1927
1927
|
|
|
1928
1928
|
const directiveEl = el[0].querySelector(
|
|
1929
1929
|
"div ui-view ng12-dynamic-directive",
|
|
@@ -1952,7 +1952,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1952
1952
|
name: "dynamicComponent",
|
|
1953
1953
|
type: "dynamicComponent",
|
|
1954
1954
|
});
|
|
1955
|
-
await wait(
|
|
1955
|
+
await wait(100);
|
|
1956
1956
|
|
|
1957
1957
|
const directiveEl = el[0].querySelector("div ui-view dynamic-component");
|
|
1958
1958
|
expect(directiveEl).toBeDefined();
|
|
@@ -1985,16 +1985,16 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1985
1985
|
it("should not be called on the initial transition", async () => {
|
|
1986
1986
|
const $state = svcs.$state;
|
|
1987
1987
|
$state.go("dynamic", { param: "abc" });
|
|
1988
|
-
await wait(
|
|
1988
|
+
await wait(100);
|
|
1989
1989
|
expect(el.text().trim()).toBe("dynamicComponent");
|
|
1990
1990
|
});
|
|
1991
1991
|
|
|
1992
1992
|
it("should be called when dynamic parameters change", async () => {
|
|
1993
1993
|
const $state = svcs.$state;
|
|
1994
1994
|
$state.go("dynamic", { param: "abc" });
|
|
1995
|
-
await wait(
|
|
1995
|
+
await wait(100);
|
|
1996
1996
|
$state.go("dynamic", { param: "def" });
|
|
1997
|
-
await wait(
|
|
1997
|
+
await wait(100);
|
|
1998
1998
|
|
|
1999
1999
|
expect(el.text().trim()).toBe("dynamicComponent def");
|
|
2000
2000
|
});
|
|
@@ -2003,9 +2003,9 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
2003
2003
|
const $state = svcs.$state,
|
|
2004
2004
|
$q = svcs.$q;
|
|
2005
2005
|
$state.go("dynamic2", { param: "abc" });
|
|
2006
|
-
await wait(
|
|
2006
|
+
await wait(100);
|
|
2007
2007
|
$state.go("dynamic2", { param: "def" });
|
|
2008
|
-
await wait(
|
|
2008
|
+
await wait(100);
|
|
2009
2009
|
|
|
2010
2010
|
expect(el.text().trim()).toBe("dynamicComponent def");
|
|
2011
2011
|
});
|
|
@@ -58,7 +58,7 @@ describe("view hooks", () => {
|
|
|
58
58
|
|
|
59
59
|
const initial = async () => {
|
|
60
60
|
$state.go("foo");
|
|
61
|
-
await wait(
|
|
61
|
+
await wait(100);
|
|
62
62
|
expect(log).toBe("");
|
|
63
63
|
expect($state.current.name).toBe("foo");
|
|
64
64
|
};
|
|
@@ -83,7 +83,7 @@ describe("view hooks", () => {
|
|
|
83
83
|
await initial();
|
|
84
84
|
|
|
85
85
|
$state.go("bar");
|
|
86
|
-
await wait(
|
|
86
|
+
await wait(100);
|
|
87
87
|
expect(log).toBe("canexit;");
|
|
88
88
|
expect($state.current.name).toBe("bar");
|
|
89
89
|
});
|
|
@@ -95,7 +95,7 @@ describe("view hooks", () => {
|
|
|
95
95
|
await initial();
|
|
96
96
|
|
|
97
97
|
$state.go("bar");
|
|
98
|
-
await wait(
|
|
98
|
+
await wait(100);
|
|
99
99
|
expect(log).toBe("canexit;");
|
|
100
100
|
expect($state.current.name).toBe("bar");
|
|
101
101
|
});
|
|
@@ -108,7 +108,7 @@ describe("view hooks", () => {
|
|
|
108
108
|
await initial();
|
|
109
109
|
|
|
110
110
|
$state.go("bar");
|
|
111
|
-
await wait(
|
|
111
|
+
await wait(100);
|
|
112
112
|
expect(log).toBe("canexit;");
|
|
113
113
|
expect($state.current.name).toBe("baz");
|
|
114
114
|
});
|
|
@@ -122,7 +122,7 @@ describe("view hooks", () => {
|
|
|
122
122
|
|
|
123
123
|
$state.defaultErrorHandler(function () {});
|
|
124
124
|
$state.go("bar");
|
|
125
|
-
await wait(
|
|
125
|
+
await wait(100);
|
|
126
126
|
expect(log).toBe("canexit;");
|
|
127
127
|
expect($state.current.name).toBe("foo");
|
|
128
128
|
});
|
|
@@ -139,7 +139,7 @@ describe("view hooks", () => {
|
|
|
139
139
|
await initial();
|
|
140
140
|
|
|
141
141
|
$state.go("bar");
|
|
142
|
-
await wait(
|
|
142
|
+
await wait(100);
|
|
143
143
|
expect(log).toBe("canexit;delay;");
|
|
144
144
|
expect($state.current.name).toBe("foo");
|
|
145
145
|
});
|
|
@@ -154,7 +154,7 @@ describe("view hooks", () => {
|
|
|
154
154
|
await initial();
|
|
155
155
|
|
|
156
156
|
$state.go("bar");
|
|
157
|
-
await wait(
|
|
157
|
+
await wait(100);
|
|
158
158
|
expect(log).toBe("canexit;delay;");
|
|
159
159
|
expect($state.current.name).toBe("bar");
|
|
160
160
|
});
|
|
@@ -166,7 +166,7 @@ describe("view hooks", () => {
|
|
|
166
166
|
await initial();
|
|
167
167
|
|
|
168
168
|
$state.go("bar");
|
|
169
|
-
await wait(
|
|
169
|
+
await wait(100);
|
|
170
170
|
expect(log).toBe("DATA");
|
|
171
171
|
expect($state.current.name).toBe("bar");
|
|
172
172
|
});
|
|
@@ -181,7 +181,7 @@ describe("view hooks", () => {
|
|
|
181
181
|
await initial();
|
|
182
182
|
|
|
183
183
|
$state.go("bar");
|
|
184
|
-
await wait(
|
|
184
|
+
await wait(100);
|
|
185
185
|
expect(log).toBe("canexit;");
|
|
186
186
|
expect($state.current.name).toBe("bar");
|
|
187
187
|
});
|
|
@@ -195,7 +195,7 @@ describe("view hooks", () => {
|
|
|
195
195
|
await initial();
|
|
196
196
|
|
|
197
197
|
$state.go("redirect");
|
|
198
|
-
await wait(
|
|
198
|
+
await wait(100);
|
|
199
199
|
expect(log).toBe("canexit;");
|
|
200
200
|
expect($state.current.name).toBe("baz");
|
|
201
201
|
});
|
|
@@ -209,7 +209,7 @@ describe("view hooks", () => {
|
|
|
209
209
|
await initial();
|
|
210
210
|
|
|
211
211
|
$state.go("redirect");
|
|
212
|
-
await wait(
|
|
212
|
+
await wait(100);
|
|
213
213
|
expect(log).toBe("canexit;");
|
|
214
214
|
expect($state.current.name).toBe("bar");
|
|
215
215
|
});
|
|
@@ -29,14 +29,14 @@ describe("uiView", () => {
|
|
|
29
29
|
$uiViewScroll(elem);
|
|
30
30
|
expect(elem[0].scrollIntoView).not.toHaveBeenCalled();
|
|
31
31
|
|
|
32
|
-
await wait(
|
|
32
|
+
await wait(100);
|
|
33
33
|
expect(elem[0].scrollIntoView).toHaveBeenCalled();
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
it("should return the promise from the timeout", async () => {
|
|
37
37
|
const promise = $uiViewScroll(elem);
|
|
38
38
|
|
|
39
|
-
await wait(
|
|
39
|
+
await wait(100);
|
|
40
40
|
expect(elem[0].scrollIntoView).toHaveBeenCalled();
|
|
41
41
|
expect(promise).toBeDefined();
|
|
42
42
|
});
|