"use strict";

exports.__esModule = true;
exports.tags = exports.aTagsArray = exports.aTag = void 0;
exports.tagsServiceMocks = tagsServiceMocks;
var _http = require("@wix/bex-utils/@wix/ambassador-os-tags-v1-tag/http");
const aTag = (overrides = {}) => {
  return {
    createdDate: new Date(),
    ...overrides
  };
};
exports.aTag = aTag;
const aTagsArray = count => Array.from({
  length: count
}, (_, index) => aTag({
  id: String(index),
  name: `Tag ${index}`
}));
exports.aTagsArray = aTagsArray;
const tags = exports.tags = aTagsArray(2);
function tagsServiceMocks(whenRequest) {
  return {
    mocks: [whenRequest(_http.listTags).reply(200, async () => {
      const data = {
        tags
      };
      return data;
    }).persist(), whenRequest(_http.createTag).reply(200, async ({
      tag
    }) => {
      return {
        tag
      };
    }).persist(), whenRequest(_http.updateTag).reply(200, async tag => {
      return tag;
    }).persist(), whenRequest(_http.deleteTag).reply(200, () => {}).persist(), whenRequest(_http.listTagsForAccount).reply(200, async () => {
      const data = {
        tags
      };
      return data;
    }).persist(), whenRequest(_http.createTagForAccount).reply(200, async ({
      tag
    }) => {
      return {
        tag
      };
    }).persist()]
  };
}
//# sourceMappingURL=tagsServiceMocks.js.map