Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('picks all the items', () => Peter.attemptsTo(
Navigate.to(shoppingListPage),
Ensure.that(Text.ofAll(picked.all()), contain('coconut milk x')),
));
it('picks all the items', () => Peter.attemptsTo(
Navigate.to(shoppingListPage),
Ensure.that(Text.ofAll(picked.all()), contain('coconut milk')),
));
it('all web elements matching the selector', () => Bernie.attemptsTo(
Navigate.to(shoppingListPage),
Ensure.that(Text.ofAll(ShoppingList.Items), contain('oats')),
));
it('records new items', function (this: WithStage) {
return this.stage.theActorCalled('Jasmine').attemptsTo(
Start.withAnEmptyList(),
RecordItem.called('Walk a dog'),
Ensure.that(RecordedItems(), contain('Walk a dog')),
);
});
it('makes it easy for an actor to pick the element of interest', () => Peter.attemptsTo(
Navigate.to(shoppingListPage),
Click.on(LinkTo(ItemCalled('coffee'))),
Ensure.that(CSSClasses.of(ItemCalled('coffee')), contain('buy')),
));
it('edits an item', function (this: WithStage) {
return this.stage.theActorCalled('Jasmine').attemptsTo(
Start.withAListContaining('Buy a cake'),
RenameItem.called('Buy a cake').to('Buy an apple'),
Ensure.that(RecordedItems(), contain('Buy an apple')),
);
});
});
describe('(when a filter is applied)', () => {
const picked = Pick.from(ShoppingList.Items).where(CSSClasses, contain('buy'));
describe('lets the actor filter the list of matching elements so that it', () => {
it('gets the number of items', () => Peter.attemptsTo(
Navigate.to(shoppingListPage),
Ensure.that(picked.count(), equals(2)),
));
it('picks all the items', () => Peter.attemptsTo(
Navigate.to(shoppingListPage),
Ensure.that(Text.ofAll(picked.all()), contain('coconut milk x')),
));
it('picks the first item', () => Peter.attemptsTo(
it('allows for a question relative to another target to be asked', () => Bernie.attemptsTo(
Navigate.to(testPage),
Ensure.that(
CSSClasses.of(
Target.the(`Element with single-class`).located(by.id('single-class')),
).of(Target.the(`list`).located(by.tagName('ul'))),
contain('pretty'),
),
));
});