<commit_before>// @flow
import React from 'react'
import { shallow } from 'enzyme'

import { resetStyled, expectCSSMatches } from './utils'

let styled

describe('css features', () => {
  beforeEach(() => {
    styled = resetStyled()
  })

  it('should add vendor prefixes in the right order', () => {
    const Comp = styled.div`
      transition: opacity 0.3s;
    `
    shallow(<Comp />)
    expectCSSMatches('.a { -webkit-transition: opacity 0.3s; transition: opacity 0.3s; }')
  })

  it('should add vendor prefixes for display', () => {
    const Comp = styled.div`
      display: flex;
      flex-direction: column;
      align-items: center;
    `
    shallow(<Comp />)
    expectCSSMatches(`
      .a {
        display: -webkit-box;
        display: -moz-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -webkit-box-direction: normal;
        -webkit-box-orient: vertical;
        -ms-flex-direction: column;
        -webkit-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: center;
        -ms-flex-align: center;
        -webkit-align-items: center;
        align-items: center;
      }
    `)
  })

  it('should handle CSS calc()', () => {
    const Comp = styled.div`
      margin-bottom: calc(15px - 0.5rem) !important;
    `
    shallow(<Comp />)
    expectCSSMatches(`
      .a {
        margin-bottom: -webkit-calc(15px - 0.5rem) !important;
        margin-bottom: -moz-calc(15px - 0.5rem) !important;
        margin-bottom: calc(15px - 0.5rem) !important;<commit_msg>Fix unnecessary test failures<commit_after>// @flow
import React from 'react'
import { shallow } from 'enzyme'

import { resetStyled, expectCSSMatches } from './utils'

let styled

describe('css features', () => {
  beforeEach(() => {
    styled = resetStyled()
  })

  it('should add vendor prefixes in the right order', () => {
    const Comp = styled.div`
      transition: opacity 0.3s;
    `
    shallow(<Comp />)
    expectCSSMatches('.a { transition: opacity 0.3s; -webkit-transition: opacity 0.3s; }')
  })

  it('should add vendor prefixes for display', () => {
    const Comp = styled.div`
      display: flex;
      flex-direction: column;
      align-items: center;
    `
    shallow(<Comp />)
    expectCSSMatches(`
      .a {
        display: -webkit-box;
        display: -moz-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        flex-direction: column;
        -webkit-box-direction: normal;
        -webkit-box-orient: vertical;
        -ms-flex-direction: column;
        -webkit-flex-direction: column;
        align-items: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        -webkit-align-items: center;
      }
    `)
  })

  it('should handle CSS calc()', () => {
    const Comp = styled.div`
      margin-bottom: calc(15px - 0.5rem) !important;
    `
    shallow(<Comp />)
    expectCSSMatches(`
      .a {
        margin-bottom: -webkit-calc(15px - 0.5rem) !important;
        margin-bottom: -moz-calc(15px - 0.5rem) !important;
        margin-bottom: calc(15px - 0.5rem) !important;
{'fraction_non_alphanumeric': 0.14675984752223634, 'fraction_numerical': 0.01397712833545108, 'mean_word_length': 2.2463917525773196, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, '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': '5246630', 'n_tokens_mistral': 1054, 'n_tokens_neox': 998, 'n_words': 234}