Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove string component type #193

Merged
merged 1 commit into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ exports[`Primitives SelectField 1`] = `"<SelectField {...rest} {...getOverridePr

exports[`Primitives StepperField 1`] = `"<StepperField {...rest} {...getOverrideProps(overrides, \\"StepperField\\")}></StepperField>"`;

exports[`Primitives StringRenderer 1`] = `"<>{\\"test\\"}</>"`;

exports[`Primitives StringRenderer throws on missing props 1`] = `"Failed to render String - Unexpected component structure"`;

exports[`Primitives SwitchField 1`] = `"<SwitchField {...rest} {...getOverrideProps(overrides, \\"SwitchField\\")}></SwitchField>"`;

exports[`Primitives Tabs 1`] = `"<Tabs {...rest} {...getOverrideProps(overrides, \\"Tabs\\")}></Tabs>"`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import { StudioComponent } from '@amzn/studio-ui-codegen';
import { assertASTMatchesSnapshot } from '../__utils__/snapshot-helpers';

import renderString from '../../amplify-ui-renderers/string';
import { AmplifyRenderer } from '../../amplify-ui-renderers/amplify-renderer';
import Primitives from '../../primitives';

Expand All @@ -36,28 +35,4 @@ describe('Primitives', () => {
});
});
});

test('StringRenderer', () => {
const component = {
componentType: 'String',
name: 'MyString',
properties: {
value: {
value: 'test',
},
},
bindingProperties: {},
};
testPrimitive(component);
});

test('StringRenderer throws on missing props', () => {
const component = {
componentType: 'String',
name: 'MyString',
properties: {},
bindingProperties: {},
};
expect(() => renderString(component)).toThrowErrorMatchingSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ import {
import Primitives from '../primitives';
import { ReactStudioTemplateRenderer } from '../react-studio-template-renderer';
import TextRenderer from './text';
import renderString from './string';
import CustomComponentRenderer from './customComponent';
import CollectionRenderer from './collection';
import { ReactComponentWithChildrenRenderer } from '../react-component-with-children-renderer';
Expand Down Expand Up @@ -329,10 +328,6 @@ export class AmplifyRenderer extends ReactStudioTemplateRenderer {
parent,
).renderElement(renderChildren);

// to be removed
case 'String':
return renderString(component as StudioComponentChild);

default:
return new CustomComponentRenderer(component, this.importCollection, parent).renderElement(renderChildren);
}
Expand Down

This file was deleted.