Skip to content

Commit

Permalink
fixture(attribute-behavior): Ensure we find the rendered element if w…
Browse files Browse the repository at this point in the history
…e render into document
  • Loading branch information
eps1lon committed Feb 10, 2023
1 parent 3273bd1 commit 96dd1bf
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
84 changes: 42 additions & 42 deletions fixtures/attribute-behavior/AttributeTableSnapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -6201,27 +6201,27 @@
## `lang` (on `<html>` inside `<document>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `lang=(string)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(empty string)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(array with string)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(empty array)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(object)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(numeric string)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(-1)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(0)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(integer)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(NaN)`| (initial, warning, ssr mismatch)| `<undefined>` |
| `lang=(float)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(true)`| (initial, warning, ssr mismatch)| `<undefined>` |
| `lang=(false)`| (initial, warning, ssr mismatch)| `<undefined>` |
| `lang=(string 'true')`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(string 'false')`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(string 'on')`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(string 'off')`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(symbol)`| (initial, warning, ssr mismatch)| `<undefined>` |
| `lang=(function)`| (initial, warning, ssr mismatch)| `<undefined>` |
| `lang=(null)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(undefined)`| (initial, ssr mismatch)| `<undefined>` |
| `lang=(string)`| (changed, ssr mismatch)| `"a string"` |
| `lang=(empty string)`| (initial)| `<empty string>` |
| `lang=(array with string)`| (changed, ssr mismatch)| `"string"` |
| `lang=(empty array)`| (initial)| `<empty string>` |
| `lang=(object)`| (changed, ssr mismatch)| `"result of toString()"` |
| `lang=(numeric string)`| (changed, ssr mismatch)| `"42"` |
| `lang=(-1)`| (changed, ssr mismatch)| `"-1"` |
| `lang=(0)`| (changed, ssr mismatch)| `"0"` |
| `lang=(integer)`| (changed, ssr mismatch)| `"1"` |
| `lang=(NaN)`| (changed, warning, ssr mismatch)| `"NaN"` |
| `lang=(float)`| (changed, ssr mismatch)| `"99.99"` |
| `lang=(true)`| (initial, warning)| `<empty string>` |
| `lang=(false)`| (initial, warning)| `<empty string>` |
| `lang=(string 'true')`| (changed, ssr mismatch)| `"true"` |
| `lang=(string 'false')`| (changed, ssr mismatch)| `"false"` |
| `lang=(string 'on')`| (changed, ssr mismatch)| `"on"` |
| `lang=(string 'off')`| (changed, ssr mismatch)| `"off"` |
| `lang=(symbol)`| (initial, warning)| `<empty string>` |
| `lang=(function)`| (initial, warning)| `<empty string>` |
| `lang=(null)`| (initial)| `<empty string>` |
| `lang=(undefined)`| (initial)| `<empty string>` |

## `length` (on `<div>` inside `<div>`)
| Test Case | Flags | Result |
Expand Down Expand Up @@ -12276,27 +12276,27 @@
## `version` (on `<html>` inside `<document>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `version=(string)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(empty string)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(array with string)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(empty array)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(object)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(numeric string)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(-1)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(0)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(integer)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(NaN)`| (initial, warning, ssr mismatch)| `<undefined>` |
| `version=(float)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(true)`| (initial, warning, ssr mismatch)| `<undefined>` |
| `version=(false)`| (initial, warning, ssr mismatch)| `<undefined>` |
| `version=(string 'true')`| (initial, ssr mismatch)| `<undefined>` |
| `version=(string 'false')`| (initial, ssr mismatch)| `<undefined>` |
| `version=(string 'on')`| (initial, ssr mismatch)| `<undefined>` |
| `version=(string 'off')`| (initial, ssr mismatch)| `<undefined>` |
| `version=(symbol)`| (initial, warning, ssr mismatch)| `<undefined>` |
| `version=(function)`| (initial, warning, ssr mismatch)| `<undefined>` |
| `version=(null)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(undefined)`| (initial, ssr mismatch)| `<undefined>` |
| `version=(string)`| (changed, ssr mismatch)| `"a string"` |
| `version=(empty string)`| (initial)| `<empty string>` |
| `version=(array with string)`| (changed, ssr mismatch)| `"string"` |
| `version=(empty array)`| (initial)| `<empty string>` |
| `version=(object)`| (changed, ssr mismatch)| `"result of toString()"` |
| `version=(numeric string)`| (changed, ssr mismatch)| `"42"` |
| `version=(-1)`| (changed, ssr mismatch)| `"-1"` |
| `version=(0)`| (changed, ssr mismatch)| `"0"` |
| `version=(integer)`| (changed, ssr mismatch)| `"1"` |
| `version=(NaN)`| (changed, warning, ssr mismatch)| `"NaN"` |
| `version=(float)`| (changed, ssr mismatch)| `"99.99"` |
| `version=(true)`| (initial, warning)| `<empty string>` |
| `version=(false)`| (initial, warning)| `<empty string>` |
| `version=(string 'true')`| (changed, ssr mismatch)| `"true"` |
| `version=(string 'false')`| (changed, ssr mismatch)| `"false"` |
| `version=(string 'on')`| (changed, ssr mismatch)| `"on"` |
| `version=(string 'off')`| (changed, ssr mismatch)| `"off"` |
| `version=(symbol)`| (initial, warning)| `<empty string>` |
| `version=(function)`| (initial, warning)| `<empty string>` |
| `version=(null)`| (initial)| `<empty string>` |
| `version=(undefined)`| (initial)| `<empty string>` |

## `version` (on `<svg>` inside `<div>`)
| Test Case | Flags | Result |
Expand Down
4 changes: 2 additions & 2 deletions fixtures/attribute-behavior/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,12 @@ function getRenderedAttributeValue(
try {
let container = createContainer();
renderer.render(react.createElement(tagName, baseProps), container);
defaultValue = read(container.firstChild);
defaultValue = read(container.lastChild);
canonicalDefaultValue = getCanonicalizedValue(defaultValue);

container = createContainer();
renderer.render(react.createElement(tagName, props), container);
result = read(container.firstChild);
result = read(container.lastChild);
canonicalResult = getCanonicalizedValue(result);
didWarn = _didWarn;
didError = false;
Expand Down

0 comments on commit 96dd1bf

Please sign in to comment.