Spy On A Complex Method Call

1 · Gleb Bahmutov · May 4, 2022, 2:06 p.m.
Here is a question that came from (deprecated) Cypress Gitter chat channel. The user provided a repo with a reproducible test that tried to assert that window.dataLayer.push method was called with an object with the field event: lead. This is just one particular call among hundreds of calls the application is making to track its various events.The user is struggling to write the correct test and asked me to help.The original test1234567891011121314151617181920212223242526272829describe('testin d...