Skip to content

CodeRabbit Generated Unit Tests: Add unit tests#406

Merged
phillipc merged 4 commits into
403-add-published-type-checks-attw-publint-to-publish-check-cifrom
coderabbitai/utg/8733691
Jun 7, 2026
Merged

CodeRabbit Generated Unit Tests: Add unit tests#406
phillipc merged 4 commits into
403-add-published-type-checks-attw-publint-to-publish-check-cifrom
coderabbitai/utg/8733691

Conversation

@coderabbitai

@coderabbitai coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Unit test generation was requested by @phillipc.

The following files were modified:

  • packages/builder/spec/builderBehaviors.ts
  • packages/utils.jsx/spec/jsxBehaviors.ts

dependabot Bot and others added 3 commits June 2, 2026 11:57
Bumps the dev-dependencies group with 1 update: [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip).


Updates `knip` from 6.14.2 to 6.15.0
- [Release notes](https://github.com/webpro-nl/knip/releases)
- [Commits](https://github.com/webpro-nl/knip/commits/knip@6.15.0/packages/knip)

---
updated-dependencies:
- dependency-name: knip
  dependency-version: 6.15.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…-2b861466cc

chore(deps-dev): bump knip from 6.14.2 to 6.15.0 in the dev-dependencies group
@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Important

Review skipped

This PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 32108584-d179-4b0a-a09c-6f331c66d1b8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.


describe('render()', () => {
it('returns an object with a node and dispose function', () => {
const result = render({ elementName: 'div', children: [], attributes: {} })
})

it('returns the single child node when jsx produces exactly one element', () => {
const result = render({ elementName: 'span', children: [], attributes: { id: 'test' } })
})

it('returns the single text node when jsx is a plain string', () => {
const result = render('hello world')
// An observable with a string value renders a text node + a comment (<!--O-->),
// which is two child nodes inside the fragment, so render() returns the fragment.
const obs = observable('a')
const result = render(obs)
})

it('returns a DocumentFragment when jsx is an array of multiple items', () => {
const result = render(['first', 'second'])
})

it('dispose() can be called without throwing', () => {
const result = render({ elementName: 'div', children: ['text'], attributes: {} })
it('returns null node when jsx produces no children (empty array)', () => {
// An empty array inserts nothing — fragment stays empty, so firstChild is null.
// fragment.childNodes.length === 0 → falls to the fragment branch (length !== 1)
const result = render([])
})

it('node property reflects the rendered element tag name', () => {
const result = render({ elementName: 'article', children: ['content'], attributes: { class: 'main' } })

it('dispose() tears down the observer so observable updates no longer apply', () => {
const obs = observable({ elementName: 'p', children: ['initial'], attributes: {} })
const result = render(obs)
@phillipc phillipc changed the base branch from main to 403-add-published-type-checks-attw-publint-to-publish-check-ci June 7, 2026 15:52
@phillipc phillipc merged commit 7c1e6c5 into 403-add-published-type-checks-attw-publint-to-publish-check-ci Jun 7, 2026
8 checks passed
@phillipc phillipc deleted the coderabbitai/utg/8733691 branch June 7, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant