All files / publisher/test-utils brand-store-requests.ts

80% Statements 8/10
100% Branches 0/0
66.66% Functions 4/6
80% Lines 8/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51                        4x   4x       4x   4x       4x   4x       4x                 4x                      
import { http, HttpResponse } from "msw";
 
import {
  accountResponse,
  snapsResponse,
  membersResponse,
  storesResponse,
  searchResponse,
} from "./brand-store-responses";
 
// @ts-expect-error - Unknown type
function brandStoreRequests(server) {
  server.use(
    http.get("/account.json", () => {
      return HttpResponse.json(accountResponse);
    }),
  );
 
  server.use(
    http.get("/api/store/test-store-id/snaps", () => {
      return HttpResponse.json(snapsResponse);
    }),
  );
 
  server.use(
    http.get("/api/store/test-store-id/members", () => {
      return HttpResponse.json(membersResponse);
    }),
  );
 
  server.use(
    http.get("/api/stores", () => {
      return HttpResponse.json({
        success: true,
        data: storesResponse,
      });
    }),
  );
 
  server.use(
    http.get(
      "/api/test-store-id/snaps/search?q=te&allowed_for_inclusion=test-store-id",
      () => {
        return HttpResponse.json(searchResponse);
      },
    ),
  );
}
 
export default brandStoreRequests;