Skip to content

Commit

Permalink
Merge branch 'master' into prevent-demo-postinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Jan 22, 2020
2 parents a9d45de + 1bd9457 commit fac034b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/browser/customBuiltInElements.test.js
Expand Up @@ -3,7 +3,9 @@ import { setupScratch, teardown } from '../_util/helpers';

/** @jsx createElement */

describe('customised built-in elements', () => {
const runSuite = typeof customElements === 'undefined' ? xdescribe : describe;

runSuite('customised built-in elements', () => {
let scratch;

beforeEach(() => {
Expand All @@ -16,10 +18,6 @@ describe('customised built-in elements', () => {

it('should create built in elements correctly', () => {
class Foo extends Component {
constructor(props) {
super(props);
return true;
}
render() {
return <div is="built-in" />;
}
Expand Down
20 changes: 20 additions & 0 deletions test/shared/createElement.test.js
Expand Up @@ -157,6 +157,25 @@ describe('createElement(jsx)', () => {
.that.equals('textstuff');
});

it('should NOT set children prop when null', () => {
let r = h('foo', {foo : 'bar'}, null);

expect(r)
.to.be.an('object')
.to.have.nested.property('props.foo')
.not.to.have.nested.property('props.children')

})

it('should NOT set children prop when unspecified', () => {
let r = h('foo', {foo : 'bar'});

expect(r)
.to.be.an('object')
.to.have.nested.property('props.foo')
.not.to.have.nested.property('props.children')
})

it('should NOT merge adjacent text children', () => {
let r = h(
'foo',
Expand Down Expand Up @@ -214,6 +233,7 @@ describe('createElement(jsx)', () => {
null
]);
});

it('should not merge children that are boolean values', () => {
let r = h('foo', null, 'one', true, 'two', false, 'three');

Expand Down

0 comments on commit fac034b

Please sign in to comment.