Skip to content

Instantly share code, notes, and snippets.

@jepetko
Created September 23, 2016 21:42
Show Gist options
  • Save jepetko/6a36ef0b88a25384bbc228a9f0a2c9c0 to your computer and use it in GitHub Desktop.
Save jepetko/6a36ef0b88a25384bbc228a9f0a2c9c0 to your computer and use it in GitHub Desktop.
describe('monkey test', () => {
let userInputs: any[] = [
{budget: 70, apple: 1, pear: 2, orange: 3},
{apple: 3, orange: 1},
{budget: 0}, // <<-- causes change detection exception
{pear: 10}
];
beforeEach(() => {
fixture.autoDetectChanges(true);
});
it('survives the monkey test', () => {
userInputs.forEach((userInput) => {
fillValueAndLeave('#budget', userInput.budget);
fillValueAndLeave('#fruit0', userInput.apple);
fillValueAndLeave('#fruit1', userInput.pear);
fillValueAndLeave('#fruit2', userInput.orange);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment