message: chore(react): write test to show fetching becomes true with executeQuery
diff: @@ -29,6 +29,9 @@ const Boundary = props => {
  );
  };
  +describe('Suspense', () => {
  + let UrqlProvider;
  +
  const PokemonsQuery = gql`
  query($skip: Int!) {
  pokemons(limit: 10, skip: $skip) {
  @@ -63,8 +66,6 @@ const Pokemons = () => {
  );
  };
  -describe('Suspense', () => {
  - let UrqlProvider: React.FC;
  beforeEach(() => {
  const client = createClient({
  url: 'https://trygql.formidable.dev/graphql/basic-pokedex',
  @@ -158,3 +159,72 @@ describe('Suspense', () => {
  });
  });
  });
  +
  +describe('executeQuery', () => {
  + let UrqlProvider;
  +
  + const PokemonsQuery = gql`
  + query {
  + pokemons(limit: 10) {
  + id
  + name
  + }
  + }
  + `;
  +
  + const Pokemons = () => {
  + const [result, excuteQuery] = useQuery({ query: PokemonsQuery });
  +
  + if (result.fetching) return <p id="loading">Loading...</p>;
  +
  + return (
  + <main>
  + <ul id="pokemon-list">
  + {result.data.pokemons.map(pokemon => (
  + <li key={pokemon.id}>
  + {pokemon.id}. {pokemon.name}
  + </li>
  + ))}
  + </ul>
  + <button
  + id="refetch"
  + onClick={() => excuteQuery({ requestPolicy: 'network-only' })}
  + >
  + Refetch
  + </button>
  + </main>
  + );
  + };
  +
  + beforeEach(() => {
  + const client = createClient({
  + url: 'https://trygql.formidable.dev/graphql/basic-pokedex',
  + suspense: false,
  + exchanges: [dedupExchange, cacheExchange, delayExchange, fetchExchange],
  + });
  +
  + // eslint-disable-next-line
  + UrqlProvider = props => {
  + return <Provider value={client}>{props.children}</Provider>;
  + };
  + });
  +
  + it('should set "fetching" to true when reexecuting', () => {
  + mount(
  + <UrqlProvider>
  + <Pokemons />
  + </UrqlProvider>
  + );
  +
  + cy.get('#loading').contains('Loading...');
  + cy.get('#pokemon-list > li').then(items => {
  + expect(items.length).to.equal(10);
  + });
  +
  + cy.get('#refetch').click();
  + cy.get('#loading').contains('Loading...');
  + cy.get('#pokemon-list > li').then(items => {
  + expect(items.length).to.equal(10);
  + });
  + });
  +});
  