# Pastebin okcuOznn describe("getCoverArt", () => { it("updates coverArtUrl state", async () => { const wrapper = shallow(); const instance = wrapper.instance(); const imageUrl = "https://i.scdn.co/image/ab67616d00004851d976f08a9feba38efcafb5ff"; instance.getCoverArt = jest.fn(); const spy = jest.fn().mockImplementation(() => { return Promise.resolve(imageUrl); }); // eslint-disable-next-line dot-notation instance["APIService"].getCoverArt = spy; expect(wrapper.state("coverArtUrl")).toBeUndefined(); await instance.componentDidMount(); expect(spy).toHaveBeenCalledWith("foo", "bar"); expect(wrapper.state("coverArtUrl")).toEqual(imageUrl); });