Testing javascript while doing an integration test

I have a button which on click calls a jquery function which has some complex functionality, then did an ajax call for creating an instance of a model. And then this calls updates the value of the model on the page.
Any idea how to test this?

Right now I just use xhr :post for testing the return value but can’t figure how to test the have_css expectation.