c# – How can I write integration tests if I need dynamically generated values from a javscript file?

We have a react website that, as part of it’s process, loads a dynamically generated javascript file from a third party. It uses some of the scripts in this javascript file to generate values, which the react website then passes to our API in an API call.

Our API then does it’s own processing and calls the third party’s API, passing back in some of the values generated from their javascript.

These values are only valid for a short time frame.

I’m looking to create some integration tests with the third party’s API, but I cannot hard code any values as they are only temporarily valid.

We would only need to perform these integration tests when we modify the client class that calls the third party, so our current solution is to manually set the values but I’m wondering if there is an existing solution to handle this?

Our API is a c# webservice writtne in .net core.