Slide 47
Slide 47 text
it('injects XSS payload into search field’, () => {
cy.get('.mat-search_icon-search').click();
cy.get('.mat-toolbar-row .mat-form-field-infix')
.type('');
cy.get('.mat-toolbar-row .mat-form-field-infix’)
.type('{enter}');
// Check if the payload is executed
let spy = cy.spy(window, 'alert');
expect(spy).to.haveOwnProperty('callCount');
expect(spy).to.not.be.called;
});