Currently, I am in the process of developing a web frontend utilizing Polymer. Within my web component, I incorporate various other components such as paper-input or custom web components. To facilitate testing for demonstration purposes, I have integrated the sinon fake xhr server to simulate elasticsearch requests - a useful tool for testing. I am leveraging the polymer appLocalizeBehavior within the web components to load locales from a json file. This behavior relies on iron-request to fetch files through an url. For filtering purposes, I have set up sinon to exclude all urls containing "locales.json" by employing the following configuration:
this._server = sinon.fakeServer.create();
this._server.autoRespond = true;
this._server.xhr.useFilters = true;
this._server.xhr.addFilter(function(method, url) {
return url.includes("locales.json");
});
Upon disabling the xhr fake server, the locales from all components load successfully. However, upon enabling sinon, it appears that the locales are being fetched but returned with incorrect encoding.
Are there any individuals experiencing similar challenges?