Skip to content

Commit

Permalink
fix(test): fix rendering attrs to snapshot (syncable values)
Browse files Browse the repository at this point in the history
  • Loading branch information
localvoid committed Jun 13, 2018
1 parent 69cc9a2 commit 9f1de27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Expand Up @@ -136,7 +136,7 @@ exports[`src/snapshot.ts special elements <audio> 1`] = `"<audio/>"`;
exports[`src/snapshot.ts special elements <input type='checkbox' checked='true'> 1`] = `
"<input
type=\\"checkbox\\"
syncInputChecked=\\"true\\"
checked=\\"true\\"
/>"
`;
Expand All @@ -148,7 +148,7 @@ exports[`src/snapshot.ts special elements <input type='checkbox'> 1`] = `
exports[`src/snapshot.ts special elements <input value='abc'> 1`] = `
"<input
syncInputValue=\\"abc\\"
value=\\"abc\\"
/>"
`;
Expand All @@ -158,7 +158,7 @@ exports[`src/snapshot.ts special elements <textarea> 1`] = `"<textarea/>"`;
exports[`src/snapshot.ts special elements <textarea>abc</textarea> 1`] = `
"<textarea
syncTextAreaValue=\\"abc\\"
value=\\"abc\\"
/>"
`;
Expand Down
3 changes: 1 addition & 2 deletions packages/ivi-test/src/snapshot.ts
@@ -1,4 +1,3 @@
import { getFunctionName } from "ivi-core";
import { VNode, VNodeFlags, StatefulComponent, StatelessComponent, SyncableValue } from "ivi";

export interface SnapshotOptions {
Expand Down Expand Up @@ -84,7 +83,7 @@ function renderAttrsToSnapshot(il: number, props: { [key: string]: any }): strin
if (typeof value === "object") {
value = value as SyncableValue<any>;
if (value !== void 0) {
result += `\n${indent(il)}${getFunctionName(value.s)}="${value.v}"`;
result += `\n${indent(il)}${key}="${value.v}"`;
}
} else if (typeof value === "boolean") {
if (value) {
Expand Down

0 comments on commit 9f1de27

Please sign in to comment.