@angular-wave/angular.ts 0.8.3 → 0.8.4

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.
Files changed (85) hide show
  1. package/@types/services/sce/sce.d.ts +0 -8
  2. package/dist/angular-ts.esm.js +29 -24
  3. package/dist/angular-ts.umd.js +29 -24
  4. package/dist/angular-ts.umd.min.js +1 -1
  5. package/docs/layouts/shortcodes/version.html +1 -1
  6. package/docs/static/typedoc/assets/style.css +9 -2
  7. package/package.json +1 -1
  8. package/src/animations/animations.test.js +1 -1
  9. package/src/binding.test.js +1 -1
  10. package/src/core/compile/compile.spec.js +2 -2
  11. package/src/core/compile/compile.test.js +1 -1
  12. package/src/core/controller/controller.test.js +1 -1
  13. package/src/core/core.test.js +1 -1
  14. package/src/core/di/injector.test.js +1 -1
  15. package/src/core/di/ng-module.test.js +1 -1
  16. package/src/core/filter/filter.test.js +1 -1
  17. package/src/core/interpolate/interpolate.test.js +1 -1
  18. package/src/core/parse/ast/ast.test.js +1 -1
  19. package/src/core/parse/interpreter.js +23 -8
  20. package/src/core/parse/lexer/lexer.test.js +1 -1
  21. package/src/core/parse/parse.test.js +1 -1
  22. package/src/core/parse/parser/parser.test.js +1 -1
  23. package/src/core/sanitize/sanitize-uri.test.js +1 -1
  24. package/src/core/scope/scope.js +3 -9
  25. package/src/core/scope/scope.spec.js +2 -2
  26. package/src/core/scope/scope.test.js +12 -0
  27. package/src/directive/aria/aria.test.js +1 -1
  28. package/src/directive/attrs/attrs.test.js +1 -1
  29. package/src/directive/attrs/boolean.test.js +1 -1
  30. package/src/directive/attrs/element-style.test.js +1 -1
  31. package/src/directive/attrs/src.test.js +1 -1
  32. package/src/directive/bind/bind.test.js +1 -1
  33. package/src/directive/channel/channel.test.js +1 -1
  34. package/src/directive/class/class-test.html +23 -0
  35. package/src/directive/class/class.test.js +1 -1
  36. package/src/directive/cloak/cloak.test.js +1 -1
  37. package/src/directive/controller/controller.test.js +1 -1
  38. package/src/directive/events/events.test.js +1 -1
  39. package/src/directive/form/form.test.js +1 -1
  40. package/src/directive/http/http.test.js +1 -1
  41. package/src/directive/if/if.test.js +1 -1
  42. package/src/directive/include/include.test.js +1 -1
  43. package/src/directive/init/init.test.js +1 -1
  44. package/src/directive/input/input.test.js +1 -1
  45. package/src/directive/messages/messages.spec.js +6 -5
  46. package/src/directive/messages/messages.test.js +2 -2
  47. package/src/directive/model/model.test.js +1 -1
  48. package/src/directive/model-options/model-option.test.js +1 -1
  49. package/src/directive/non-bindable/non-bindable.test.js +1 -1
  50. package/src/directive/observe/observe.test.js +1 -1
  51. package/src/directive/on/on.test.js +1 -1
  52. package/src/directive/options/options.test.js +1 -1
  53. package/src/directive/ref/href.test.js +2 -2
  54. package/src/directive/repeat/repeat.spec.js +61 -61
  55. package/src/directive/repeat/repeat.test.js +2 -2
  56. package/src/directive/script/script.test.js +1 -1
  57. package/src/directive/select/select.test.js +1 -1
  58. package/src/directive/setter/setter.test.js +1 -1
  59. package/src/directive/show-hide/show-hide.test.js +1 -1
  60. package/src/directive/style/style.test.js +1 -1
  61. package/src/directive/switch/switch.test.js +1 -1
  62. package/src/directive/validators/validators.test.js +1 -1
  63. package/src/filters/filters.test.js +1 -1
  64. package/src/router/directives/state-directives.test.js +1 -1
  65. package/src/router/directives/view-directive.spec.js +9 -6
  66. package/src/router/directives/view-directive.test.js +1 -1
  67. package/src/router/glob/glob.test.js +1 -1
  68. package/src/router/router.test.js +1 -1
  69. package/src/router/state/state.test.js +1 -1
  70. package/src/router/template-factory.spec.js +1 -4
  71. package/src/router/template-factory.test.js +1 -1
  72. package/src/router/url/url.test.js +1 -1
  73. package/src/router/view/view.test.js +1 -1
  74. package/src/services/http/http.test.js +1 -1
  75. package/src/services/http-backend/http-backend.test.js +1 -1
  76. package/src/services/location/location.test.js +1 -1
  77. package/src/services/log/log.test.js +1 -1
  78. package/src/services/pubsub/pubsub.test.js +1 -1
  79. package/src/services/sce/sce.js +7 -6
  80. package/src/services/sce/sce.test.js +1 -1
  81. package/src/services/template-cache/template-cache.test.js +1 -1
  82. package/src/shared/shared.test.js +1 -1
  83. package/src/shared/url-utils/url-utils.test.js +1 -1
  84. package/src/src.test.js +1 -1
  85. package/src/loader.md +0 -0
@@ -1 +1 @@
1
- <p>Version: 0.8.3</p>
1
+ <p>Version: 0.8.4</p>
@@ -504,8 +504,15 @@
504
504
  body {
505
505
  background: var(--color-background);
506
506
  font-family:
507
- -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
508
- Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
507
+ -apple-system,
508
+ BlinkMacSystemFont,
509
+ "Segoe UI",
510
+ "Noto Sans",
511
+ Helvetica,
512
+ Arial,
513
+ sans-serif,
514
+ "Apple Color Emoji",
515
+ "Segoe UI Emoji";
509
516
  font-size: 16px;
510
517
  color: var(--color-text);
511
518
  margin: 0;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@angular-wave/angular.ts",
3
3
  "description": "A modern, optimized and type-safe version of AngularJS",
4
4
  "license": "MIT",
5
- "version": "0.8.3",
5
+ "version": "0.8.4",
6
6
  "type": "module",
7
7
  "main": "dist/angular-ts.esm.js",
8
8
  "module": "dist/angular-ts.esm.js",
@@ -5,6 +5,6 @@ test("raf-scheduler unit tests contain no errors", async ({ page }) => {
5
5
  await page.content();
6
6
 
7
7
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
8
- /0 failures/,
8
+ / 0 failures/,
9
9
  );
10
10
  });
@@ -5,6 +5,6 @@ test("src tests contain no errors", async ({ page }) => {
5
5
  await page.content();
6
6
  await page.waitForTimeout(6000);
7
7
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
8
- /0 failures/,
8
+ / 0 failures/,
9
9
  );
10
10
  });
@@ -14397,14 +14397,14 @@ describe("$compile", () => {
14397
14397
  "http://example.com/image1.jpg?x=a2x,b 1x,http://example.com/ima,ge2.jpg 2x":
14398
14398
  "http://example.com/image1.jpg?x=a2x,b 1x,http://example.com/ima,ge2.jpg 2x",
14399
14399
  };
14400
- Object.entries(testSet).forEach(async ([url, ref]) => {
14400
+ for (const [url, ref] of Object.entries(testSet)) {
14401
14401
  it("should sanitize all uris in srcset " + url, async () => {
14402
14402
  element = $compile('<img srcset="{{testUrl}}"></img>')($rootScope);
14403
14403
  $rootScope.testUrl = url;
14404
14404
  await wait();
14405
14405
  expect(element.getAttribute("srcset")).toEqual(ref);
14406
14406
  });
14407
- });
14407
+ }
14408
14408
  });
14409
14409
 
14410
14410
  describe("a[href] sanitization", () => {
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(4000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(100);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(5000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -5,6 +5,6 @@ test("lexer unit tests contain no errors", async ({ page }) => {
5
5
  await page.content();
6
6
  await page.waitForTimeout(3000);
7
7
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
8
- /0 failures/,
8
+ / 0 failures/,
9
9
  );
10
10
  });
@@ -1,4 +1,9 @@
1
- import { isDefined, isFunction, isObject } from "../../shared/utils.js";
1
+ import {
2
+ isDefined,
3
+ isFunction,
4
+ isObject,
5
+ isProxy,
6
+ } from "../../shared/utils.js";
2
7
  import { ASTType } from "./ast-type.js";
3
8
 
4
9
  export const PURITY_ABSOLUTE = 1;
@@ -140,7 +145,7 @@ export class ASTInterpreter {
140
145
  ? (scope, locals, assign) => {
141
146
  const values = [];
142
147
  for (let i = 0; i < args.length; ++i) {
143
- const res = args[i](scope, locals, assign);
148
+ const res = args[i](scope.$target, locals, assign);
144
149
  values.push(res);
145
150
  }
146
151
  const value = () => {
@@ -151,7 +156,11 @@ export class ASTInterpreter {
151
156
  : value;
152
157
  }
153
158
  : (scope, locals, assign) => {
154
- const rhs = right(scope, locals, assign);
159
+ const rhs = right(
160
+ scope.$target ? scope.$target : scope,
161
+ locals,
162
+ assign,
163
+ );
155
164
  let value;
156
165
  if (rhs.value != null && isFunction(rhs.value)) {
157
166
  const values = [];
@@ -169,7 +178,11 @@ export class ASTInterpreter {
169
178
  return (scope, locals, assign) => {
170
179
  const lhs = left(scope, locals, assign);
171
180
  const rhs = right(scope, locals, assign);
172
- lhs.context[lhs.name] = rhs;
181
+ // lhs.context[lhs.name] = rhs;
182
+ const ctx = isProxy(lhs.context)
183
+ ? lhs.context
184
+ : (lhs.context.$proxy ?? lhs.context);
185
+ ctx[lhs.name] = rhs;
173
186
  return context ? { value: rhs } : rhs;
174
187
  };
175
188
  case ASTType.ArrayExpression:
@@ -222,8 +235,10 @@ export class ASTInterpreter {
222
235
  case ASTType.ThisExpression:
223
236
  return (scope) => (context ? { value: scope } : scope);
224
237
  case ASTType.LocalsExpression:
238
+ // @ts-ignore
225
239
  return (scope, locals) => (context ? { value: locals } : locals);
226
240
  case ASTType.NGValueParameter:
241
+ // @ts-ignore
227
242
  return (scope, locals, assign) =>
228
243
  context ? { value: assign } : assign;
229
244
  }
@@ -494,9 +509,9 @@ export class ASTInterpreter {
494
509
  */
495
510
  "ternary?:"(test, alternate, consequent, context) {
496
511
  return (scope, locals, assign) => {
497
- const arg = test(scope, locals, assign)
498
- ? alternate(scope, locals, assign)
499
- : consequent(scope, locals, assign);
512
+ const arg = test(scope.$target, locals, assign)
513
+ ? alternate(scope.$target, locals, assign)
514
+ : consequent(scope.$target, locals, assign);
500
515
  return context ? { value: arg } : arg;
501
516
  };
502
517
  }
@@ -527,7 +542,7 @@ export class ASTInterpreter {
527
542
  }
528
543
  let value = undefined;
529
544
  if (base) {
530
- value = base[name];
545
+ value = base["$target"] ? base["$target"][name] : base[name];
531
546
  }
532
547
  if (context) {
533
548
  return { context: base, name, value };
@@ -5,6 +5,6 @@ test("lexer unit tests contain no errors", async ({ page }) => {
5
5
  await page.content();
6
6
  await page.waitForTimeout(100);
7
7
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
8
- /0 failures/,
8
+ / 0 failures/,
9
9
  );
10
10
  });
@@ -5,6 +5,6 @@ test("parser unit tests contain no errors", async ({ page }) => {
5
5
  await page.content();
6
6
  await page.waitForTimeout(100);
7
7
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
8
- /0 failures/,
8
+ / 0 failures/,
9
9
  );
10
10
  });
@@ -5,6 +5,6 @@ test("parser unit tests contain no errors", async ({ page }) => {
5
5
  await page.content();
6
6
  await page.waitForTimeout(100);
7
7
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
8
- /0 failures/,
8
+ / 0 failures/,
9
9
  );
10
10
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(100);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -791,12 +791,6 @@ export class Scope {
791
791
 
792
792
  // 14
793
793
  case ASTType.ObjectExpression: {
794
- // get.decoratedNode.body[0].expression.expression.forEach(x => {
795
- // x.toWatch[0].name
796
- // });
797
-
798
- // key = get.decoratedNode.body[0].expression.properties[0].key.name;
799
- // listener.property.push(key);
800
794
  get.decoratedNode.body[0].expression.properties.forEach((prop) => {
801
795
  if (prop.key.isPure === false) {
802
796
  keySet.push(prop.key.name);
@@ -806,7 +800,8 @@ export class Scope {
806
800
  keySet.push(prop.value.name);
807
801
  listener.property.push(key);
808
802
  } else {
809
- key = get.decoratedNode.body[0].expression.properties[0].key.name;
803
+ key =
804
+ get.decoratedNode.body[0].expression.toWatch[0].property.name;
810
805
  listener.property.push(key);
811
806
  }
812
807
  }
@@ -957,8 +952,7 @@ export class Scope {
957
952
 
958
953
  $eval(expr, locals) {
959
954
  const fn = $parse(expr);
960
- const res = fn(this.$target, locals);
961
-
955
+ const res = fn(this, locals);
962
956
  if (isUndefined(res) || res === null) {
963
957
  return res;
964
958
  }
@@ -795,7 +795,7 @@ describe("Scope", () => {
795
795
  { expression: "false && 2", expected: false },
796
796
  ];
797
797
 
798
- cases.forEach(async ({ expression, expected }) => {
798
+ for (const { expression, expected } of cases) {
799
799
  it("passes constants to listener cb " + expression, async () => {
800
800
  let res;
801
801
  scope.$watch(expression, (val) => {
@@ -805,7 +805,7 @@ describe("Scope", () => {
805
805
  await wait();
806
806
  expect(res).toEqual(expected);
807
807
  });
808
- });
808
+ }
809
809
  });
810
810
 
811
811
  describe("expressions", () => {
@@ -0,0 +1,12 @@
1
+ import { test, expect } from "@playwright/test";
2
+
3
+ const TEST_URL = "src/core/scope/scope.html?random=false";
4
+
5
+ test("unit tests contain no errors", async ({ page }) => {
6
+ await page.goto(TEST_URL);
7
+ await page.content();
8
+ await page.waitForTimeout(1000);
9
+ await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
+ / 0 failures/,
11
+ );
12
+ });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(3000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(3000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -5,6 +5,6 @@ test("unit observer tests contain no errors", async ({ page }) => {
5
5
  await page.content();
6
6
  await page.waitForTimeout(1000);
7
7
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
8
- /0 failures/,
8
+ / 0 failures/,
9
9
  );
10
10
  });
@@ -0,0 +1,23 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>AngularTS</title>
6
+ <link rel="shortcut icon" type="image/png" href="images/favicon.ico" />
7
+ <script type="module" src="/src/index.js"></script>
8
+ </head>
9
+ <body ng-app ng-init="test = {deleted: false}">
10
+ <style>
11
+ .red {
12
+ background-color: red;
13
+ }
14
+ </style>
15
+
16
+ {{ test.deleted }}
17
+ <p ng-class="{red: test.deleted}">Map Syntax Example</p>
18
+ <label>
19
+ <input type="checkbox" ng-model="test.deleted" />deleted (apply "strike"
20
+ class)
21
+ </label>
22
+ </body>
23
+ </html>
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(10000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,7 +7,7 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
 
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
13
13
 
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(3000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -1,23 +1,24 @@
1
1
  import { Angular } from "../../angular.js";
2
2
  import { wait } from "../../shared/test-utils.js";
3
3
  import { isString } from "../../shared/utils.js";
4
- import { getController } from "../../shared/dom.js";
4
+ import { dealoc, getController } from "../../shared/dom.js";
5
5
 
6
6
  describe("ngMessages", () => {
7
- let $rootScope, $compile, $templateCache;
7
+ let $rootScope, $compile, $templateCache, el;
8
8
 
9
9
  beforeEach(() => {
10
+ el = document.getElementById("app");
11
+ dealoc(el);
10
12
  window.angular = new Angular();
11
- window.angular.module("app", ["ng"]).directive("messageWrap", () => ({
13
+ window.angular.module("app", []).directive("messageWrap", () => ({
12
14
  transclude: true,
13
15
  scope: {
14
16
  col: "=col",
15
17
  },
16
18
  template: '<div ng-messages="col"><ng-transclude></ng-transclude></div>',
17
19
  }));
18
-
19
20
  window.angular
20
- .bootstrap(document.getElementById("app"), ["app"])
21
+ .bootstrap(el, ["app"])
21
22
  .invoke((_$rootScope_, _$compile_, _$templateCache_) => {
22
23
  $rootScope = _$rootScope_;
23
24
  $compile = _$compile_;
@@ -1,12 +1,12 @@
1
1
  import { test, expect } from "@playwright/test";
2
2
 
3
- const TEST_URL = "src/directive/messages/messages.html";
3
+ const TEST_URL = "src/directive/messages/messages.html?random=false";
4
4
 
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -5,6 +5,6 @@ test("unit observer tests contain no errors", async ({ page }) => {
5
5
  await page.content();
6
6
  await page.waitForTimeout(1000);
7
7
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
8
- /0 failures/,
8
+ / 0 failures/,
9
9
  );
10
10
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(1000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -7,6 +7,6 @@ test("unit tests contain no errors", async ({ page }) => {
7
7
  await page.content();
8
8
  await page.waitForTimeout(3000);
9
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
10
- /0 failures/,
10
+ / 0 failures/,
11
11
  );
12
12
  });
@@ -5,7 +5,7 @@ test("unit href tests contain no errors", async ({ page }) => {
5
5
  await page.content();
6
6
  await page.waitForTimeout(1000);
7
7
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
8
- /0 failures/,
8
+ / 0 failures/,
9
9
  );
10
10
  });
11
11
 
@@ -14,6 +14,6 @@ test("unit ref tests contain no errors", async ({ page }) => {
14
14
  await page.content();
15
15
  await page.waitForTimeout(1000);
16
16
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
17
- /0 failures/,
17
+ / 0 failures/,
18
18
  );
19
19
  });