-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move to initializer for final package
Expects a div id Expects a function to call for opening templates
- Loading branch information
1 parent
e992f44
commit de59aa1
Showing
6 changed files
with
49 additions
and
10 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
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,19 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import Browser from '../../src/components/Browser'; | ||
import create from '../spec-helpers'; | ||
|
||
describe('Feature: Users can open templates', () => { | ||
it('calls the attached function with expected params', () => { | ||
const templates = [ | ||
create('template', {id: 23, type: 'TextOnly'}) | ||
]; | ||
const openTemplate = jest.fn( () => {} ); | ||
const app = mount(<Browser templates={templates} onTemplateOpen={ openTemplate } />); | ||
|
||
app.find('Template').simulate('click'); | ||
|
||
expect(openTemplate.mock.calls[0]).toEqual([23, 'TextOnly']); | ||
}); | ||
|
||
}); |
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
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
This file was deleted.
Oops, something went wrong.
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