Skip to content

Commit

Permalink
Removed additional testcases lit-ref.raw.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
raghul.kumar committed Oct 15, 2024
1 parent f8ef754 commit 4699280
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 199 deletions.
137 changes: 0 additions & 137 deletions packages/core/src/__tests__/__snapshots__/lit.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3117,68 +3117,6 @@ export default class MyBasicComponent extends LitElement {
"
`;

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

@customElement(\\"my-icon\\")
export default class Icon extends LitElement {
createRenderRoot() {
return this;
}

@query('[ref=\\"hostRef\\"]')
hostRef!: HTMLElement;

@property() color: any;
@property() colorSecondary: any;
@property() ariaLabel: any;

setColors(colors) {
if (!this.hostRef) {
return;
}

if (colors.primary) {
this.hostRef.style.setProperty(\\"--color-primary\\", colors.primary);
} else {
this.hostRef.style.removeProperty(\\"--color-primary\\");
}

if (colors.secondary) {
this.hostRef.style.setProperty(\\"--color-secondary\\", colors.secondary);
} else {
this.hostRef.style.removeProperty(\\"--color-secondary\\");
}
}

connectedCallback() {
this.setColors({
primary: this.color,
secondary: this.colorSecondary,
});
}

updated() {
this.setColors({
primary: this.color,
secondary: this.colorSecondary,
});
}

render() {
return html\`

<div aria-label=\\"\${this.ariaLabel}\\" ref=\\"hostRef\\">
<svg viewBox=\\"0 0 24 24\\" fill=\\"none\\"></svg>
</div>

\`;
}
}
"
`;

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

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

type Colors = {
primary?: string;
secondary?: string;
};
interface IconProps {
icon: string;
size?: \\"xs\\" | \\"md\\" | number;
type?: \\"solid\\" | \\"line\\";
ariaLabel?: string;
color?: string;
colorSecondary?: string;
}

@customElement(\\"my-icon\\")
export default class Icon extends LitElement {
createRenderRoot() {
return this;
}

@query('[ref=\\"hostRef\\"]')
hostRef!: HTMLElement;

@property() color: any;
@property() colorSecondary: any;
@property() ariaLabel: any;

setColors(colors: Colors) {
if (!this.hostRef) {
return;
}

if (colors.primary) {
this.hostRef.style.setProperty(\\"--color-primary\\", colors.primary);
} else {
this.hostRef.style.removeProperty(\\"--color-primary\\");
}

if (colors.secondary) {
this.hostRef.style.setProperty(\\"--color-secondary\\", colors.secondary);
} else {
this.hostRef.style.removeProperty(\\"--color-secondary\\");
}
}

connectedCallback() {
this.setColors({
primary: this.color,
secondary: this.colorSecondary,
});
}

updated() {
this.setColors({
primary: this.color,
secondary: this.colorSecondary,
});
}

render() {
return html\`

<div aria-label=\\"\${this.ariaLabel}\\" ref=\\"hostRef\\">
<svg viewBox=\\"0 0 24 24\\" fill=\\"none\\"></svg>
</div>

\`;
}
}
"
`;

exports[`Lit > jsx > Typescript Test > referencingFunInsideHook 1`] = `
"import { LitElement, html, css } from \\"lit\\";
import { customElement, property, state, query } from \\"lit/decorators.js\\";
Expand Down
58 changes: 0 additions & 58 deletions packages/core/src/__tests__/data/lit-ref.raw.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions packages/core/src/__tests__/test-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ const inputToTextInputRN = getRawFile('./data/react-native/text-input.raw.tsx');

const StringLiteralStore = getRawFile('./data/string-literal-store.raw.tsx');
const StringLiteralStoreKebab = getRawFile('./data/string-literal-store-kebab.raw.tsx');
const ref = getRawFile('./data/lit-ref.raw.tsx');

/**
* Use TestsWithFailFor when you want to write a test that you know will fail
Expand Down Expand Up @@ -165,8 +164,6 @@ const REACT_NATIVE_TESTS: Tests = {
inputToTextInputRN,
};

const LIT_REF_TEST: Tests = {};

const BASIC_TESTS: Tests = {
Basic: basic,
BasicAttribute: basicAttribute,
Expand Down Expand Up @@ -247,7 +244,6 @@ const BASIC_TESTS: Tests = {
useTarget,
signalsOnUpdate,
getterState,
ref,
'string-literal-store': StringLiteralStore,
'string-literal-store-kebab': {
file: StringLiteralStoreKebab,
Expand Down

0 comments on commit 4699280

Please sign in to comment.