<commit_before>import React from 'react'
import chai, { expect } from 'chai'
chai.use(require('chai-enzyme')())
import { shallow } from 'enzyme'
// import { spy } from 'sinon'
chai.use(require('sinon-chai'))
import OrderItem from './components/orderItem'
import sampleOrders from './sampleOrders.test.data'

/* global describe it beforeEach */
describe.only('<OrderItem />', () => {
  let root
  let product
  beforeEach('render the root', () => {
    let orderItem = sampleOrders[0].orderItems[0]
    // console.log('ORDERITEM: ', orderItem)
    product = orderItem.inventory.product
    let vendor = orderItem.inventory.vendor
    root = shallow(<OrderItem orderItem={orderItem} product={product} vendor={vendor}/>)
  })

  it('Has a row', () => {
    expect(root.find('div[className="row"]')).to.have.length(1);
  })

  it('Has two columns', () => {
    expect(root.find('div[className="col-md-6"]')).to.have.length(2);
  })

  it('Has a header with the product name', () => {
    expect(root.find('h4[className="product-name"]')).to.have.length(1);
  })

  it('Has a paragraph with item delivery status', () => {
    expect(root.find('p[className="item-delivery-status"]')).to.have.length(1);
  })

  it('Has a paragraph with item price', () => {
    expect(root.find('p[className="item-price"]')).to.have.length(1);
  })

  it('Has a paragraph with quantity', () => {
    expect(root.find('p[className="quantity"]')).to.have.length(1);
  })

  it('Has a paragraph with vendor name', () => {
    expect(root.find('p[className="vendor-name"]')).to.have.length(1);
  })

  it('Has a link to the product', () => {
    expect(root.find('Link')).to.have.length(1);
  })

  it('Has an image of the product', () => {
    expect(root.find('img')).to.have.length(1);
  })

//   it('Has a paragraph with item price', () => {
//     expect(root.find('hr[className="order-seperator"]')).to.have.length(1);
//   })
})
<commit_msg>Finished order item test<commit_after>import React from 'react'
import chai, { expect } from 'chai'
chai.use(require('chai-enzyme')())
import { shallow } from 'enzyme'
// import { spy } from 'sinon'
chai.use(require('sinon-chai'))
import OrderItem from './components/orderItem'
import sampleOrders from './sampleOrders.test.data'

/* global describe it beforeEach */
describe.only('<OrderItem />', () => {
  let root
  let product
  beforeEach('render the root', () => {
    let orderItem = sampleOrders[0].orderItems[0]
    // console.log('ORDERITEM: ', orderItem)
    product = orderItem.inventory.product
    let vendor = orderItem.inventory.vendor
    root = shallow(<OrderItem orderItem={orderItem} product={product} vendor={vendor}/>)
  })

  it('Has a row', () => {
    expect(root.find('div[className="row"]')).to.have.length(1);
  })

  it('Has two columns', () => {
    expect(root.find('div[className="col-md-6"]')).to.have.length(2);
  })

  it('Has a header with the product name', () => {
    expect(root.find('h4[className="product-name"]')).to.have.length(1);
  })

  it('Has a paragraph with item delivery status', () => {
    expect(root.find('p[className="item-delivery-status"]')).to.have.length(1);
  })

  it('Has a paragraph with item price', () => {
    expect(root.find('p[className="item-price"]')).to.have.length(1);
  })

  it('Has a paragraph with quantity', () => {
    expect(root.find('p[className="quantity"]')).to.have.length(1);
  })

  it('Has a paragraph with vendor name', () => {
    expect(root.find('p[className="vendor-name"]')).to.have.length(1);
  })

  it('Has a link to the product', () => {
    expect(root.find('Link[to]')).to.have.length(1);
  })

  it('Has an image of the product', () => {
    expect(root.find('img')).to.have.length(1);
    expect(root.find('img')).to.have.attr('src').equals(product.images[0]);
  })

//   it('Has a paragraph with item price', () => {
//     expect(root.find('hr[className="order-seperator"]')).to.have.length(1);
//   })
})

{'fraction_non_alphanumeric': 0.2138316806509026, 'fraction_numerical': 0.00737350622934147, 'mean_word_length': 4.0114649681528665, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 31, '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': '2335297', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1324, 'n_words': 242}