<commit_before>import styles from './style.postcss';

import React from 'react';
import pure from 'recompose/pure';
import classnames from 'classnames';
import is from 'is_js';
import PropTypes from 'prop-types';

const PageCardHeading = (props) => {
  const { className, text } = props;

  return <header className={classnames(styles.PageCardHeading, className, {
    [styles.__stackHorizontal]: props.stackMode === 'horizontal',
  })}>
    {is.string(text) && text.length ?
      <h1 className={styles.PageCardHeading_h1}>
        {text}
      </h1> : null}
    {props.children}
  </header>;
};

PageCardHeading.propTypes = {
  className: PropTypes.string,
  text: PropTypes.string,
  stackMode: PropTypes.oneOf(['vertical', 'horizontal']),  // default: vertical
  children: PropTypes.node,
};

export default pure(PageCardHeading);
<commit_msg>[automation] add test a className for pageCard<commit_after>import styles from './style.postcss';

import React from 'react';
import pure from 'recompose/pure';
import classnames from 'classnames';
import is from 'is_js';
import PropTypes from 'prop-types';
import testClass from 'domain/testClass';

const PageCardHeading = (props) => {
  const { className, text } = props;
  const textAbbr = is.string(text) &&
    text.replace(/\s+/g, '-').replace(/'/, '').toLowerCase();
  const textClassName = textAbbr && testClass(`${textAbbr}-page-card`);
  return <header className={classnames(styles.PageCardHeading, className, {
    [styles.__stackHorizontal]: props.stackMode === 'horizontal',
    [textClassName]: is.existy(textAbbr),
  })}>
    {is.string(text) && text.length ?
      <h1 className={styles.PageCardHeading_h1}>
        {text}
      </h1> : null}
    {props.children}
  </header>;
};

PageCardHeading.propTypes = {
  className: PropTypes.string,
  text: PropTypes.string,
  stackMode: PropTypes.oneOf(['vertical', 'horizontal']),  // default: vertical
  children: PropTypes.node,
};

export default pure(PageCardHeading);

{'fraction_non_alphanumeric': 0.15136226034308778, 'fraction_numerical': 0.0030272452068617556, 'mean_word_length': 4.508333333333334, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '3005037', 'n_tokens_mistral': 612, 'n_tokens_neox': 617, 'n_words': 146}