<commit_before>import React from 'react';
import { mount, shallow } from 'enzyme';
import Text from 'components/text';
import TextField from 'components/text-field';

describe('Text field', () => {
  test('Accepts proxy props', () => {
    const textField = mount(
      <TextField type="password" />,
    );

    expect(textField.find('input').props().type).toBe('password');
  });

  test('Label and sublabels', () => {
    const textField = shallow(
      <TextField
        label="label"
        sublabel="sublabel"
      />,
    );

    expect(textField.find(Text).length).toBe(2);
    expect(textField.find(Text).at(0).children().text()).toBe('label');
    expect(textField.find(Text).at(1).children().text()).toBe('sublabel');
  });

  test('Error message', () => {
    const textField = shallow(
      <TextField
        error="error"
      />,
    );

    expect(textField.find(Text).length).toBe(1);
    expect(textField.find(Text).at(0).children().text()).toBe('error');
  });
});<commit_msg>Update TextField tests to reflect secondary style<commit_after>import React from 'react';
import { mount, shallow } from 'enzyme';
import Text from 'components/text';
import TextField from 'components/text-field';

describe('Text field', () => {
  test('Accepts proxy props', () => {
    const textField = mount(
      <TextField type="password" />,
    );

    expect(textField.find('input').props().type).toBe('password');
  });

  test('Label and sublabels', () => {
    const textField = shallow(
      <TextField
        label="label"
        sublabel="sublabel"
      />,
    );

    expect(textField.find(Text).length).toBe(2);
    expect(textField.find(Text).at(0).children().text()).toBe('label');
    expect(textField.find(Text).at(1).children().text()).toBe('sublabel');
  });

  test('Error message', () => {
    const textField = shallow(
      <TextField
        error="error"
      />,
    );

    expect(textField.find(Text).length).toBe(1);
    expect(textField.find(Text).at(0).children().text()).toBe('error');
  });

  test('Primary style', () => {
    const textField = shallow(
      <TextField />,
    );

    expect(textField.find('input').props().style.border).toBeDefined();
  });

  test('Secondary style', () => {
    const textField = shallow(
      <TextField secondary />,
    );

    expect(textField.find('input').props().style.border).toBe(undefined);
    expect(textField.find('input').props().style.borderBottom).toBeDefined();
  });
});
{'fraction_non_alphanumeric': 0.1987075928917609, 'fraction_numerical': 0.004038772213247173, 'mean_word_length': 3.439068100358423, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1865196', 'n_tokens_mistral': 758, 'n_tokens_neox': 738, 'n_words': 120}