Skip to content

Commit

Permalink
chore: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
nmerget committed Nov 1, 2024
1 parent e73fb9a commit 0ed644b
Show file tree
Hide file tree
Showing 14 changed files with 3,431 additions and 227 deletions.
208 changes: 206 additions & 2 deletions packages/core/src/__tests__/__snapshots__/lit.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ export default class MyBasicRefComponent extends LitElement {

onBlur = function onBlur() {
// Maintain focus
this.inputRef.focus();
this.inputRef?.focus();
};
lowerCaseName = function lowerCaseName() {
return this.name.toLowerCase();
Expand Down Expand Up @@ -1505,6 +1505,34 @@ export default class Stepper extends LitElement {
"
`;

exports[`Lit > jsx > Javascript Test > NestedStore 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";

@customElement(\\"nested-store\\")
export default class NestedStore extends LitElement {
createRenderRoot() {
return this;
}

@state() _id = \\"abc\\";
@state() _messageId = this._id + \\"-message\\";

render() {
return html\`

<div .id=\\"\${this._id}\\">
Test

<p .id=\\"\${this._messageId}\\">Message</p>
</div>

\`;
}
}
"
`;

exports[`Lit > jsx > Javascript Test > RawText 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";
Expand Down Expand Up @@ -1952,6 +1980,46 @@ export default class Textarea extends LitElement {
"
`;

exports[`Lit > jsx > Javascript Test > UseValueAndFnFromStore 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";

@customElement(\\"use-value-and-fn-from-store\\")
export default class UseValueAndFnFromStore extends LitElement {
createRenderRoot() {
return this;
}

@property() onChange: any;

@state() _id = \\"abc\\";
@state() _active = false;

_do(id) {
this._active = !!id;

if (this.onChange) {
this.onChange(this._active);
}
}

updated() {
if (this._do) {
this._do(this._id);
}
}

render() {
return html\`

<div>Test</div>

\`;
}
}
"
`;

exports[`Lit > jsx > Javascript Test > Video 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";
Expand Down Expand Up @@ -3661,6 +3729,33 @@ export default class MyComponent extends LitElement {
"
`;

exports[`Lit > jsx > Javascript Test > setState 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";

@customElement(\\"set-state\\")
export default class SetState extends LitElement {
createRenderRoot() {
return this;
}

@state() n = [\\"123\\"];

someFn() {
this.n[0] = \\"123\\";
}

render() {
return html\`

<div ><button @click=\${(event) =>
this.someFn()} >Click me</button></div>
\`;
}
}
"
`;

exports[`Lit > jsx > Javascript Test > showExpressions 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";
Expand Down Expand Up @@ -4853,7 +4948,7 @@ export default class MyBasicRefComponent extends LitElement {

onBlur = function onBlur() {
// Maintain focus
this.inputRef.focus();
this.inputRef?.focus();
};
lowerCaseName = function lowerCaseName() {
return this.name.toLowerCase();
Expand Down Expand Up @@ -6009,6 +6104,39 @@ export default class Stepper extends LitElement {
"
`;

exports[`Lit > jsx > Typescript Test > NestedStore 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";

type MyStore = {
_id?: string;
_messageId?: string;
};

@customElement(\\"nested-store\\")
export default class NestedStore extends LitElement {
createRenderRoot() {
return this;
}

@state() _id = \\"abc\\";
@state() _messageId = this._id + \\"-message\\";

render() {
return html\`

<div .id=\\"\${this._id}\\">
Test

<p .id=\\"\${this._messageId}\\">Message</p>
</div>

\`;
}
}
"
`;

exports[`Lit > jsx > Typescript Test > RawText 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";
Expand Down Expand Up @@ -6526,6 +6654,55 @@ export default class Textarea extends LitElement {
"
`;

exports[`Lit > jsx > Typescript Test > UseValueAndFnFromStore 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";

type MyProps = {
onChange?: (active: boolean) => void;
};
type MyStore = {
_id?: string;
_active?: boolean;
_do?: (id?: string) => void;
};

@customElement(\\"use-value-and-fn-from-store\\")
export default class UseValueAndFnFromStore extends LitElement {
createRenderRoot() {
return this;
}

@property() onChange: any;

@state() _id = \\"abc\\";
@state() _active = false;

_do(id?: string) {
this._active = !!id;

if (this.onChange) {
this.onChange(this._active);
}
}

updated() {
if (this._do) {
this._do(this._id);
}
}

render() {
return html\`

<div>Test</div>

\`;
}
}
"
`;

exports[`Lit > jsx > Typescript Test > Video 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";
Expand Down Expand Up @@ -8402,6 +8579,33 @@ export default class MyComponent extends LitElement {
"
`;

exports[`Lit > jsx > Typescript Test > setState 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";

@customElement(\\"set-state\\")
export default class SetState extends LitElement {
createRenderRoot() {
return this;
}

@state() n = [\\"123\\"];

someFn() {
this.n[0] = \\"123\\";
}

render() {
return html\`

<div ><button @click=\${(event) =>
this.someFn()} >Click me</button></div>
\`;
}
}
"
`;

exports[`Lit > jsx > Typescript Test > showExpressions 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";
Expand Down
Loading

0 comments on commit 0ed644b

Please sign in to comment.