-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add inherited properties test #2263
base: main
Are you sure you want to change the base?
Changes from all commits
a6beb22
9b66359
ad31807
d8cb9d8
8be969b
22be6ae
a28dd5f
e103ad3
16c7eaf
63c8773
d6042f4
3d2f142
cd47c10
65b9177
4cbaa95
a150005
a75ccf3
5bef7e2
b89e837
430fb2f
3fc0c2b
7917e80
9e41e90
f263682
6536e19
f154bf0
e11ab34
b0dd42f
78fe699
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* @license | ||
* Copyright 2023 Google Inc. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
class CEBaseClass extends HTMLElement { | ||
set bool(value) { | ||
this._bool = value; | ||
} | ||
get bool() { | ||
return this._bool; | ||
} | ||
set num(value) { | ||
this._num = value; | ||
} | ||
get num() { | ||
return this._num; | ||
} | ||
set str(value) { | ||
this._str = value; | ||
} | ||
get str() { | ||
return this._str; | ||
} | ||
set arr(value) { | ||
this._arr = value; | ||
} | ||
get arr() { | ||
return this._arr; | ||
} | ||
set obj(value) { | ||
this._obj = value; | ||
} | ||
get obj() { | ||
return this._obj; | ||
} | ||
set camelCaseObj(value) { | ||
this._camelCaseObj = value; | ||
} | ||
get camelCaseObj() { | ||
return this._camelCaseObj; | ||
} | ||
} | ||
class CEWithInheritance extends CEBaseClass {} | ||
customElements.define('ce-with-inheritance', CEWithInheritance); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
{ | ||
"success": 30, | ||
"success": 32, | ||
"failed": 2, | ||
"skipped": 0, | ||
"error": false, | ||
"disconnected": false, | ||
"exitCode": 1, | ||
"score": 94, | ||
"score": 95, | ||
"basicSupport": { | ||
"total": 16, | ||
"failed": 0, | ||
"passed": 16 | ||
}, | ||
"advancedSupport": { | ||
"total": 16, | ||
"total": 18, | ||
"failed": 2, | ||
"passed": 14 | ||
"passed": 16 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,7 @@ | ||||||||||||||||||||||||||||||||||||||||||||
import 'ce-without-children'; | ||||||||||||||||||||||||||||||||||||||||||||
import 'ce-with-children'; | ||||||||||||||||||||||||||||||||||||||||||||
import 'ce-with-properties'; | ||||||||||||||||||||||||||||||||||||||||||||
import 'ce-with-inheritance'; | ||||||||||||||||||||||||||||||||||||||||||||
import 'ce-with-event'; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
const ComponentWithoutChildren = { | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -81,6 +82,34 @@ const ComponentWithProps = { | |||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
const ComponentWithInheritance = { | ||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know much about angularjs but looking at what's already here, i think the component needs to be added here: custom-elements-everywhere/libraries/angularjs/src/app.module.js Lines 1 to 21 in c5c71ed
needs to import .component('compWithInheritance', ComponentWithInheritance) and the top of this file also has import lines, which probably needs this added import 'ce-with-inheritance'; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm.... it's working w/o that, but I'm not sure what that means. |
||||||||||||||||||||||||||||||||||||||||||||
template: ` | ||||||||||||||||||||||||||||||||||||||||||||
<div> | ||||||||||||||||||||||||||||||||||||||||||||
<ce-with-inheritance id="wc" | ||||||||||||||||||||||||||||||||||||||||||||
ng-prop-bool="$ctrl.bool" | ||||||||||||||||||||||||||||||||||||||||||||
ng-prop-num="$ctrl.num" | ||||||||||||||||||||||||||||||||||||||||||||
ng-prop-str="$ctrl.str" | ||||||||||||||||||||||||||||||||||||||||||||
ng-prop-arr="$ctrl.arr" | ||||||||||||||||||||||||||||||||||||||||||||
ng-prop-obj="$ctrl.obj" | ||||||||||||||||||||||||||||||||||||||||||||
ng-prop-camel-case-obj="$ctrl.camelCaseObj" | ||||||||||||||||||||||||||||||||||||||||||||
></ce-with-inheritance> | ||||||||||||||||||||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||||||||||||||||||||
`, | ||||||||||||||||||||||||||||||||||||||||||||
controller: class { | ||||||||||||||||||||||||||||||||||||||||||||
constructor() {} | ||||||||||||||||||||||||||||||||||||||||||||
$onInit() { | ||||||||||||||||||||||||||||||||||||||||||||
angular.extend(this, { | ||||||||||||||||||||||||||||||||||||||||||||
bool: true, | ||||||||||||||||||||||||||||||||||||||||||||
num: 42, | ||||||||||||||||||||||||||||||||||||||||||||
str: 'Angular', | ||||||||||||||||||||||||||||||||||||||||||||
arr: ['A', 'n', 'g', 'u', 'l', 'a', 'r'], | ||||||||||||||||||||||||||||||||||||||||||||
obj: { org: 'angular', repo: 'angular' }, | ||||||||||||||||||||||||||||||||||||||||||||
camelCaseObj: { label: "passed" } | ||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
const ComponentWithImperativeEvent = { | ||||||||||||||||||||||||||||||||||||||||||||
template: ` | ||||||||||||||||||||||||||||||||||||||||||||
<div> | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -154,6 +183,7 @@ export { | |||||||||||||||||||||||||||||||||||||||||||
ComponentWithChildrenRerender, | ||||||||||||||||||||||||||||||||||||||||||||
ComponentWithDifferentViews, | ||||||||||||||||||||||||||||||||||||||||||||
ComponentWithProps, | ||||||||||||||||||||||||||||||||||||||||||||
ComponentWithInheritance, | ||||||||||||||||||||||||||||||||||||||||||||
ComponentWithImperativeEvent, | ||||||||||||||||||||||||||||||||||||||||||||
ComponentWithDeclarativeEvent | ||||||||||||||||||||||||||||||||||||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check bools, nums, and strings? Or do you want to do that in a basic test? Follow up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow up PR?