Created
September 5, 2018 13:28
-
-
Save cfv1984/f292f04adc3a08c59b271b41368d9ee9 to your computer and use it in GitHub Desktop.
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
// imports omitidos por brevedad | |
const feature = loadFeature('./test/features/list-all-albums.feature'); | |
defineFeature(feature, test => { | |
test('Viewing the Gallery', ({given, when, then}) => { | |
let testInstance; | |
let gallery; | |
given('the Gallery component is present', () => { | |
const renderer = TestRenderer.create( <Gallery data={MockData}/> ); | |
Gallery = renderer.root; | |
testInstance = renderer; | |
}); | |
when('the component is rendered', () => { | |
// mock any init steps that happen at render time | |
}); | |
then('I want the component to have an Album for each gallery in the site', () => { | |
const albums = gallery.findAllByType(Album); | |
expect(albums.length).toEqual(MockData.albums); | |
}); | |
then('I want the Album to hold a Thumbnail for each image in it', () => { | |
let album = gallery.findByType(Album); | |
Let thumbs; | |
expect(album).toBeDefined(); | |
thumbs = album.findAllByType(Thumbnail); | |
expect(thumbs.length).toEqual(MockData[1].photos.length); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment