Skip to content

Commit

Permalink
test: Completed the FilterableProductTable test
Browse files Browse the repository at this point in the history
  • Loading branch information
romarioraffington committed Aug 12, 2017
1 parent 4a84b68 commit de9aba8
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/components/FilterableProductTable/index.spec.js
@@ -0,0 +1,34 @@
// External Depedencies
import React from 'react';
import { shallow } from 'enzyme';

// Our Dependencies
import { expect } from '../../utils/chai';
import { generateProductList } from '../../utils/testData';

// Our Component
import FilterableProductTable from './index';

describe('FilterableProductTable', () => {
let wrapper;
const products = generateProductList();

// Render the component in the beforeEach so
// each test can get a new shallow rendered wrapper
beforeEach(() => {
wrapper = shallow(
<FilterableProductTable
products={products}
/>
)
});

// Checking the intitial state
it('should initialize the filterText state to an empty string', () => {
expect(wrapper).to.have.state('filterText').to.equal('');
});

it('should initialize the inStockOnly state to false', () => {
expect(wrapper).to.have.state('inStockOnly').to.equal(false);
})
});

0 comments on commit de9aba8

Please sign in to comment.