hyochan / dooboo-ui-legacy

React Native UI Components with react-hook (web, ios, android)
MIT License
140 stars 72 forks source link

feat(rating): new customItem and containerStyle properties[Rating] #364

Closed JeffGuKang closed 3 years ago

JeffGuKang commented 3 years ago

Description

User can customize rating component called customItem and containerStyle using their own component instead of default start image.

Related Issues

363

Tests

I added the following tests:

it('should simulate customItem and containerStyle props', (): void => {
      const rendered = renderer.create(
        component({
          ...defaultProps,
          customItem: {
            onComponent: <View />,
            offComponent: <View />,
          },
          containerStyle: {
            width: 300,
          },
          testID: 'RATING_ID',
        }),
      );

      rendered.update(component({ value: 3 }));
      expect(rendered).toMatchSnapshot();
      expect(rendered).toBeTruthy();

      rendered.update(component({ disabled: true }));
      expect(rendered).toMatchSnapshot();
      expect(rendered).toBeTruthy();
});

Snapshot is updated by npx jest rating -u

Checklist

Before you create this PR confirms that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

JeffGuKang commented 3 years ago

There is a lint error not related this PR while testing.

/home/circleci/dooboo/packages/PinchZoom/index.tsx
  227:63  error  Missing semicolon  semi
image