Last active
June 12, 2019 05:27
-
-
Save eyaleizenberg/23655e8bbca0a0ef0e89f5d02022cc68 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { HelloPersonDriver } from './hello-person.driver'; | |
describe('Hello Person', () => { | |
let driver: HelloPersonDriver; | |
beforeEach(() => { | |
driver = new HelloPersonDriver(); | |
}); | |
test('should render the name from the prop', () => { | |
driver.given.name('Jenia').when.rendered(); | |
expect(driver.get.renderedName()).toBe('Jenia'); | |
}); | |
test('should fetch data with Eyal as the variable', () => { | |
driver.given.name('Eyal').when.rendered(); | |
expect(driver.get.reportSpy()).toHaveBeenCalledWith('Eyal'); | |
}); | |
test('should not fetch data if the name is not Eyal', () => { | |
driver.given.name('Tal').when.rendered(); | |
expect(driver.get.reportSpy()).not.toHaveBeenCalled(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment