Skip to content

Commit

Permalink
fix(core): BuilderIO#793 svelte props spread (BuilderIO#797)
Browse files Browse the repository at this point in the history
* fix(core): BuilderIO#793 svelte props spread

* test(core): add tests for spreads
  • Loading branch information
raymondmuller authored Oct 11, 2022
1 parent 41aa637 commit a90c9b6
Show file tree
Hide file tree
Showing 22 changed files with 6,121 additions and 3,997 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2604,6 +2604,47 @@ export default class NestedShow {
"
`;
exports[`Angular with Preserve Imports and File Extensions Javascript Test spreadAttrs 1`] = `
"import { Component } from \\"@angular/core\\";
@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {}
"
`;
exports[`Angular with Preserve Imports and File Extensions Javascript Test spreadNestedProps 1`] = `
"import { Component, Input } from \\"@angular/core\\";
@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {
@Input() nested: any;
}
"
`;
exports[`Angular with Preserve Imports and File Extensions Javascript Test spreadProps 1`] = `
"import { Component } from \\"@angular/core\\";
@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {}
"
`;
exports[`Angular with Preserve Imports and File Extensions Javascript Test subComponent 1`] = `
"import { Component } from \\"@angular/core\\";
Expand Down Expand Up @@ -5315,6 +5356,47 @@ export default class NestedShow {
"
`;
exports[`Angular with Preserve Imports and File Extensions Typescript Test spreadAttrs 1`] = `
"import { Component } from \\"@angular/core\\";
@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {}
"
`;
exports[`Angular with Preserve Imports and File Extensions Typescript Test spreadNestedProps 1`] = `
"import { Component, Input } from \\"@angular/core\\";
@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {
@Input() nested: any;
}
"
`;
exports[`Angular with Preserve Imports and File Extensions Typescript Test spreadProps 1`] = `
"import { Component } from \\"@angular/core\\";
@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {}
"
`;
exports[`Angular with Preserve Imports and File Extensions Typescript Test subComponent 1`] = `
"import { Component } from \\"@angular/core\\";
Expand Down
182 changes: 182 additions & 0 deletions packages/core/src/__tests__/__snapshots__/angular.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5406,6 +5406,97 @@ export default class NestedShow {
"
`;

exports[`Angular Javascript Test spreadAttrs 1`] = `
"import { Component } from \\"@angular/core\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {}
"
`;

exports[`Angular Javascript Test spreadAttrs 2`] = `
"import { Component } from \\"@angular/core\\";
import { CommonModule } from \\"@angular/common\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
standalone: true,
imports: [CommonModule],
})
export default class MyBasicComponent {}
"
`;

exports[`Angular Javascript Test spreadNestedProps 1`] = `
"import { Component, Input } from \\"@angular/core\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {
@Input() nested: any;
}
"
`;

exports[`Angular Javascript Test spreadNestedProps 2`] = `
"import { Component, Input } from \\"@angular/core\\";
import { CommonModule } from \\"@angular/common\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
standalone: true,
imports: [CommonModule],
})
export default class MyBasicComponent {
@Input() nested: any;
}
"
`;

exports[`Angular Javascript Test spreadProps 1`] = `
"import { Component } from \\"@angular/core\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {}
"
`;

exports[`Angular Javascript Test spreadProps 2`] = `
"import { Component } from \\"@angular/core\\";
import { CommonModule } from \\"@angular/common\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
standalone: true,
imports: [CommonModule],
})
export default class MyBasicComponent {}
"
`;

exports[`Angular Javascript Test subComponent 1`] = `
"import { Component } from \\"@angular/core\\";

Expand Down Expand Up @@ -11038,6 +11129,97 @@ export default class NestedShow {
"
`;

exports[`Angular Typescript Test spreadAttrs 1`] = `
"import { Component } from \\"@angular/core\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {}
"
`;

exports[`Angular Typescript Test spreadAttrs 2`] = `
"import { Component } from \\"@angular/core\\";
import { CommonModule } from \\"@angular/common\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
standalone: true,
imports: [CommonModule],
})
export default class MyBasicComponent {}
"
`;

exports[`Angular Typescript Test spreadNestedProps 1`] = `
"import { Component, Input } from \\"@angular/core\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {
@Input() nested: any;
}
"
`;

exports[`Angular Typescript Test spreadNestedProps 2`] = `
"import { Component, Input } from \\"@angular/core\\";
import { CommonModule } from \\"@angular/common\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
standalone: true,
imports: [CommonModule],
})
export default class MyBasicComponent {
@Input() nested: any;
}
"
`;

exports[`Angular Typescript Test spreadProps 1`] = `
"import { Component } from \\"@angular/core\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
})
export default class MyBasicComponent {}
"
`;

exports[`Angular Typescript Test spreadProps 2`] = `
"import { Component } from \\"@angular/core\\";
import { CommonModule } from \\"@angular/common\\";

@Component({
selector: \\"my-basic-component, MyBasicComponent\\",
template: \`
<input />
\`,
standalone: true,
imports: [CommonModule],
})
export default class MyBasicComponent {}
"
`;

exports[`Angular Typescript Test subComponent 1`] = `
"import { Component } from \\"@angular/core\\";

Expand Down
30 changes: 30 additions & 0 deletions packages/core/src/__tests__/__snapshots__/html.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4537,6 +4537,21 @@ exports[`Html Javascript Test showWithFor 1`] = `
"
`;

exports[`Html Javascript Test spreadAttrs 1`] = `
"<input data-el=\\"input-1\\" data-dom-state=\\"input-2\\" />
"
`;

exports[`Html Javascript Test spreadNestedProps 1`] = `
"<input data-el=\\"input-1\\" data-dom-state=\\"input-2\\" />
"
`;

exports[`Html Javascript Test spreadProps 1`] = `
"<input data-el=\\"input-1\\" data-dom-state=\\"input-2\\" />
"
`;

exports[`Html Javascript Test subComponent 1`] = `
"<Foo></Foo>
"
Expand Down Expand Up @@ -9222,6 +9237,21 @@ exports[`Html Typescript Test showWithFor 1`] = `
"
`;

exports[`Html Typescript Test spreadAttrs 1`] = `
"<input data-el=\\"input-1\\" data-dom-state=\\"input-2\\" />
"
`;

exports[`Html Typescript Test spreadNestedProps 1`] = `
"<input data-el=\\"input-1\\" data-dom-state=\\"input-2\\" />
"
`;

exports[`Html Typescript Test spreadProps 1`] = `
"<input data-el=\\"input-1\\" data-dom-state=\\"input-2\\" />
"
`;

exports[`Html Typescript Test subComponent 1`] = `
"<Foo></Foo>
"
Expand Down
30 changes: 30 additions & 0 deletions packages/core/src/__tests__/__snapshots__/liquid.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,21 @@ exports[`Liquid Javascript Test showWithFor 1`] = `
"
`;
exports[`Liquid Javascript Test spreadAttrs 1`] = `
"<input />
"
`;

exports[`Liquid Javascript Test spreadNestedProps 1`] = `
"<input />
"
`;

exports[`Liquid Javascript Test spreadProps 1`] = `
"<input />
"
`;

exports[`Liquid Javascript Test subComponent 1`] = `
"<Foo></Foo>
"
Expand Down Expand Up @@ -1302,6 +1317,21 @@ exports[`Liquid Typescript Test showWithFor 1`] = `
"
`;
exports[`Liquid Typescript Test spreadAttrs 1`] = `
"<input />
"
`;

exports[`Liquid Typescript Test spreadNestedProps 1`] = `
"<input />
"
`;

exports[`Liquid Typescript Test spreadProps 1`] = `
"<input />
"
`;

exports[`Liquid Typescript Test subComponent 1`] = `
"<Foo></Foo>
"
Expand Down
Loading

0 comments on commit a90c9b6

Please sign in to comment.