Skip to content

Commit 1f87068

Browse files
Add camel case named property test (#2239)
* Add camelCase property to shared web component * Fix typo in update-goldens command * Update expected tests to 32 * Add Svelte test * Add Angular test * Add AngularJS test * Add Dio test * Add Dojo test * Add Hybrids test * Add Hyperapp test * Add hyperHTML test * Add Lit test * Add Mithril test * Add Omi test * Add Polymer test * Add Preact test * Add React test * Add React experimental test * Add Riot test * Add Skate test * Add Solid test * Add Stencil test * Add Surplus test * Add Vue test * Format expected results
1 parent fa77020 commit 1f87068

File tree

71 files changed

+362
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+362
-112
lines changed

libraries/__shared__/webcomponents/src/ce-with-properties.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ class CEWithProperties extends HTMLElement {
4646
get obj() {
4747
return this._obj;
4848
}
49+
set camelCaseObj(value) {
50+
this._camelCaseObj = value;
51+
}
52+
get camelCaseObj() {
53+
return this._camelCaseObj;
54+
}
4955
}
5056

5157
customElements.define('ce-with-properties', CEWithProperties);

libraries/angular/meta/expectedResults.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"success": 30,
2+
"success": 32,
33
"failed": 0,
44
"skipped": 0,
55
"error": false,
@@ -12,8 +12,8 @@
1212
"passed": 16
1313
},
1414
"advancedSupport": {
15-
"total": 14,
15+
"total": 16,
1616
"failed": 0,
17-
"passed": 14
17+
"passed": 16
1818
}
1919
}

libraries/angular/src/advanced-tests.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ describe("advanced support", function() {
6868
let data = wc.obj;
6969
expect(data).to.eql({ org: "angular", repo: "angular" });
7070
});
71+
72+
it("will pass object data to a camelCase-named property", function() {
73+
this.weight = 2;
74+
let fixture = TestBed.createComponent(ComponentWithProperties);
75+
fixture.detectChanges();
76+
let root = fixture.debugElement.nativeElement;
77+
let wc = root.querySelector("#wc");
78+
let data = wc.camelCaseObj;
79+
expect(data).to.eql({ label: "passed" });
80+
});
7181
});
7282

7383
describe("events", function() {

libraries/angular/src/components.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export class ComponentWithDifferentViews {
8989
[str]="data.str"
9090
[arr]="data.arr"
9191
[obj]="data.obj"
92+
[camelCaseObj]="data.camelCaseObj"
9293
></ce-with-properties>
9394
</div>
9495
`
@@ -99,7 +100,8 @@ export class ComponentWithProperties {
99100
num: 42,
100101
str: 'Angular',
101102
arr: ['A', 'n', 'g', 'u', 'l', 'a', 'r'],
102-
obj: { org: 'angular', repo: 'angular' }
103+
obj: { org: 'angular', repo: 'angular' },
104+
camelCaseObj: { label: "passed" }
103105
}
104106
}
105107

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
22
"success": 30,
3-
"failed": 0,
3+
"failed": 2,
44
"skipped": 0,
55
"error": false,
66
"disconnected": false,
7-
"exitCode": 0,
8-
"score": 100,
7+
"exitCode": 1,
8+
"score": 94,
99
"basicSupport": {
1010
"total": 16,
1111
"failed": 0,
1212
"passed": 16
1313
},
1414
"advancedSupport": {
15-
"total": 14,
16-
"failed": 0,
15+
"total": 16,
16+
"failed": 2,
1717
"passed": 14
1818
}
1919
}

libraries/angularjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"output": [
3636
"results"
3737
],
38-
"command": "cross-env LIBRARY_NAME=angular karma start"
38+
"command": "cross-env LIBRARY_NAME=angular karma start || echo ''"
3939
},
4040
"build": {
4141
"dependencies": [

libraries/angularjs/src/advanced-tests.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ describe("advanced support", () => {
3838
let data = wc.obj;
3939
expect(data).to.eql({ org: "angular", repo: "angular" });
4040
});
41+
42+
it("will pass object data to a camelCase-named property", function() {
43+
this.weight = 2;
44+
let root = prep("<comp-with-props>")
45+
scope.$digest()
46+
let wc = root.querySelector('#wc')
47+
let data = wc.camelCaseObj;
48+
expect(data).to.eql({ label: "passed" });
49+
});
4150
});
4251

4352
describe("events", () => {

libraries/angularjs/src/components.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const ComponentWithProps = {
6262
ng-prop-str="$ctrl.str"
6363
ng-prop-arr="$ctrl.arr"
6464
ng-prop-obj="$ctrl.obj"
65+
ng-prop-camel-case-obj="$ctrl.camelCaseObj"
6566
></ce-with-properties>
6667
</div>
6768
`,
@@ -73,7 +74,8 @@ const ComponentWithProps = {
7374
num: 42,
7475
str: 'Angular',
7576
arr: ['A', 'n', 'g', 'u', 'l', 'a', 'r'],
76-
obj: { org: 'angular', repo: 'angular' }
77+
obj: { org: 'angular', repo: 'angular' },
78+
camelCaseObj: { label: "passed" }
7779
});
7880
}
7981
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"success": 24,
2+
"success": 26,
33
"failed": 6,
44
"skipped": 0,
55
"error": false,
66
"disconnected": false,
77
"exitCode": 1,
8-
"score": 91,
8+
"score": 92,
99
"basicSupport": {
1010
"total": 16,
1111
"failed": 0,
1212
"passed": 16
1313
},
1414
"advancedSupport": {
15-
"total": 14,
15+
"total": 16,
1616
"failed": 6,
17-
"passed": 8
17+
"passed": 10
1818
}
1919
}

libraries/dio/src/advanced-tests.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ describe("advanced support", function() {
6363
let data = wc.obj;
6464
expect(data).to.eql({ org: "thysultan", repo: "dio.js" });
6565
});
66+
67+
it("will pass object data to a camelCase-named property", function() {
68+
this.weight = 2;
69+
render(<ComponentWithProperties />, scratch);
70+
let wc = scratch.querySelector("#wc");
71+
let data = wc.camelCaseObj;
72+
expect(data).to.eql({ label: "passed" });
73+
});
74+
6675
});
6776

6877
describe("events", function() {

0 commit comments

Comments
 (0)