<commit_before>// A11Y
// const { axe, toHaveNoViolations } = require('jest-axe')
// expect.extend(toHaveNoViolations)
// import ReactDOMServer from 'react-dom/server'

// Standard
import React from 'react'
import ReactDOM from 'react-dom'

// Component to test
// import { JestTestSetup } from 'views/components/JestTestSetup'

// import injectTapEventPlugin from 'react-tap-event-plugin'
import ThemeManager from 'material-ui/lib/styles/theme-manager'
import FirstVoicesTheme from 'views/themes/FirstVoicesTheme.js'
import ConfGlobal from 'conf/local.js'

// Providers provide reducers and actions
import providers from '../../providers/index'

// Views
import AppWrapper from '../AppWrapper'

// require('!style-loader!css-loader!normalize.css')
// require('!style-loader!css-loader!alloyeditor/dist/alloy-editor/assets/alloy-editor-ocean-min.css')
// require('!style-loader!css-loader!tether-shepherd/dist/css/shepherd-theme-arrows.css')
// require('bootstrap/less/bootstrap')
// require('styles/main')

// injectTapEventPlugin()

const context = {
  providers,
  /*combinedProviders: [
      providers // OK for all providers to share the same store for now, make sure actions are unique
    ],*/
  providedState: {
    properties: {
      title: ConfGlobal.title,
      pageTitleParams: null,
      domain: ConfGlobal.domain,
      theme: {
        palette: ThemeManager.getMuiTheme(FirstVoicesTheme),
        id: 'default',
      },
    },
  },
}
describe('AppWrapper', () => {
  test('Mounts', () => {
    // Structure: Arrange
    const container = document.createElement('div')
    ReactDOM.render(<AppWrapper {...context} />, container)

    expect(container.querySelector('#pageNavigation').textContent).toMatch('SIGN IN')
    expect(container.querySelector('#pageFooter').textContent).toMatch('<EMAIL>')

    // Structure: Act
    // Structure: Assert
  })

  // test('Accessibility', async() => {
  //   const html = ReactDOMServer.renderToString(<AppWrapper {...context} />)
  //   const results = await axe(html)
  //   expect(results).toHaveNoViolations()
  // })
})<commit_msg>Jest: updated AppWrapper test to work w/redux<commit_after>// A11Y
// const { axe, toHaveNoViolations } = require('jest-axe')
// expect.extend(toHaveNoViolations)
// import ReactDOMServer from 'react-dom/server'

// Standard
import React from 'react'
import ReactDOM from 'react-dom'

// Providers provide reducers and actions
import providers from 'providers/index'
import { Provider } from 'react-redux'
import store from 'providers/redux/store'

// Component to test
// import { JestTestSetup } from 'views/components/JestTestSetup'

// import injectTapEventPlugin from 'react-tap-event-plugin'
import ThemeManager from 'material-ui/lib/styles/theme-manager'
import FirstVoicesTheme from 'views/themes/FirstVoicesTheme.js'
import ConfGlobal from 'conf/local.js'

// Views
import AppWrapper from '../AppWrapper'

// require('!style-loader!css-loader!normalize.css')
// require('!style-loader!css-loader!alloyeditor/dist/alloy-editor/assets/alloy-editor-ocean-min.css')
// require('!style-loader!css-loader!tether-shepherd/dist/css/shepherd-theme-arrows.css')
// require('bootstrap/less/bootstrap')
// require('styles/main')

// injectTapEventPlugin()

const context = {
  providers,
  /*combinedProviders: [
      providers // OK for all providers to share the same store for now, make sure actions are unique
    ],*/
  providedState: {
    properties: {
      title: ConfGlobal.title,
      pageTitleParams: null,
      domain: ConfGlobal.domain,
      theme: {
        palette: ThemeManager.getMuiTheme(FirstVoicesTheme),
        id: 'default',
      },
    },
  },
}
describe('AppWrapper', () => {
  test('Mounts', () => {
    // Structure: Arrange
    const container = document.createElement('div')
    ReactDOM.render(
      <Provider store={store}>
        <AppWrapper {...context} />
      </Provider>,
      container)

    expect(container.querySelector('#pageNavigation').textContent).toMatch('SIGN IN')
    expect(container.querySelector('#pageFooter').textContent).toMatch('<EMAIL>')

    // Structure: Act
    // Structure: Assert
  })

  // test('Accessibility', async() => {
  //   const html = ReactDOMServer.renderToString(<AppWrapper {...context} />)
  //   const results = await axe(html)
  //   expect(results).toHaveNoViolations()
  // })
})
{'fraction_non_alphanumeric': 0.148819078193075, 'fraction_numerical': 0.0009172208209126347, 'mean_word_length': 3.710583153347732, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '5830178', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1315, 'n_words': 268}