Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Completed the FilterableProductTable test
- Loading branch information
1 parent
4a84b68
commit de9aba8
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}) | ||
}); |