keyValueTable.spec.tsx 760 B

1234567891011121314151617181920
  1. import {mountWithTheme} from 'sentry-test/enzyme';
  2. import {KeyValueTable, KeyValueTableRow} from 'app/components/keyValueTable';
  3. describe('KeyValueTable', function () {
  4. it('basic', function () {
  5. const wrapper = mountWithTheme(
  6. <KeyValueTable>
  7. <KeyValueTableRow keyName="Coffee" value="Black hot drink" />
  8. <KeyValueTableRow keyName="Milk" value={<a href="#">White cold drink</a>} />
  9. </KeyValueTable>
  10. );
  11. expect(wrapper.find('dl').exists()).toBeTruthy();
  12. expect(wrapper.find('dt').at(0).text()).toBe('Coffee');
  13. expect(wrapper.find('dd').at(0).text()).toBe('Black hot drink');
  14. expect(wrapper.find('dt').at(1).text()).toBe('Milk');
  15. expect(wrapper.find('dd a').text()).toBe('White cold drink');
  16. });
  17. });