在React App中使用Storybook,以便如何为Storybook元素定义TestID

时间:2018-10-31 06:47:53

标签: detox

下面是Storybook元素,因此如何为这些元素定义test_ID 有人可以帮我吗 以下是Storybook元素,因此如何为这些元素定义test_ID

import { Spacings } from 'constants/layout'

import React from 'react'
import { CenteredStoriesOf } from 'storybook/helpers'
import WrapperWithTitle from 'components/atoms/wrapper-with-title'
import Spacer from 'components/atoms/spacer'

import ButtonWithRipple from './index'

CenteredStoriesOf('Atoms/Buttons', module).add('ripple', () => (
  <WrapperWithTitle title={'Buttons with ripple'}>
    <ButtonWithRipple text={'This is a button'} onPress={() => {}} />
    <Spacer height={Spacings.S} />
    <ButtonWithRipple
      text={
        'This is a button with a very long text and it is maybe even too long'
      }
      onPress={() => {}}
    />
    <Spacer height={Spacings.S} />
    <ButtonWithRipple
      text={'This is a bordered button'}
      isButtonBordered
      onPress={() => {}}
    />
  </WrapperWithTitle>
))

0 个答案:

没有答案