Skip to content

Commit 57fc2f8

Browse files
committed
omi
1 parent 083f7eb commit 57fc2f8

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

libraries/omi/src/basic-tests.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ describe("basic support", function () {
102102
expect(data).to.eql("Omi");
103103
});
104104

105+
it("will not overwrite unwriteable properties", function () {
106+
this.weight = 3;
107+
let root = render(<component-without-properties />, scratch);
108+
let wc = root.shadowRoot.querySelector("#wc");
109+
expect(wc.getAttribute('amethod')).to.eql('method');
110+
expect(wc.getAttribute('agetter')).to.eql('getter');
111+
expect(wc.getAttribute('areadonly')).to.eql('readonly');
112+
expect(wc.innerHTML).to.eql('Success');
113+
});
114+
105115
// it('will set boolean attributes on a Custom Element that has not already been defined and upgraded', function () {
106116
// let root = render(<component-with-unregistered />, scratch);
107117
// let wc = root.shadowRoot.querySelector('#wc');

libraries/omi/src/components.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'ce-without-children'
33
import 'ce-with-children'
44
import 'ce-with-properties'
55
import 'ce-with-event'
6+
import 'ce-without-properties'
67

78
define('component-without-children', _ => (
89
<div>
@@ -78,6 +79,23 @@ define('component-with-properties', _ => {
7879

7980
})
8081

82+
define('component-without-properties', _ => {
83+
const data = {
84+
method: 'method',
85+
getter: 'getter',
86+
readonly: 'readonly'
87+
}
88+
return (
89+
<div>
90+
<ce-without-properties id="wc"
91+
amethod={data.method}
92+
agetter={data.getter}
93+
areadonly={data.readonly}
94+
></ce-without-properties>
95+
</div>
96+
)
97+
})
98+
8199

82100

83101

0 commit comments

Comments
 (0)