示例#1
0
        test('shows the title of the diagram', () => {
            // create a store to test with
            const store = createStore()
            // the title of the diagram
            const title = 'test title'

            // set the title of the store
            store.dispatch(setDiagramTitle(title))

            // render the component
            const wrapper = mount(
                <Provider store={store}>
                    <Title />
                </Provider>
            )

            // make sure there is a title element with the correct text
            expect(wrapper.containsMatchingElement(<h1>{title}</h1>)).toBeTruthy()
        })
示例#2
0
 onChange={({ target }) => dispatch(setDiagramTitle(target.value))}