src/app/components/Embeds/FlourishEmbed/fixtures.ts

Summary

Maintainability
A
0 mins
Test Coverage
export const AsianGamesFootballProps = {
  version: '1.0',
  provider_name: 'Flourish',
  provider_url: 'https://flourish.studio',
  html: '<iframe src="https://flo.uri.sh/visualisation/14873063/embed" frameborder="0" scrolling="no" height="575" width="700" style="width:100%;" title="Interactive or visual content"></iframe>',
  width: 700,
  height: 575,
  type: 'rich',
  iFrameSrc: 'https://flo.uri.sh/visualisation/14873063/embed?auto=1',
  iFrameId: 'flourish-id-04499c96',
  iFrameTitle: 'Interactive or visual content',
  sizeAdjustScript:
    "\n    window.addEventListener('message', function (event) {\n      var _message$src;\n      var message = typeof event.data === 'string' && JSON.parse(event.data);\n      if ((message === null || message === void 0 ? void 0 : message.sender) === 'Flourish' \n      && (message === null || message === void 0 ? void 0 : message.context) === 'iframe.resize' \n      && message !== null && message !== void 0 && (_message$src = message.src) !== null && _message$src !== void 0 && _message$src.includes('https://flo.uri.sh/visualisation/14873063/embed?auto=1')) {\n        document.getElementById('flourish-id-04499c96').style.height = message.height + 'px';\n      }\n    });",
  source: 'https://public.flourish.studio/visualisation/14873063',
  oEmbedType: 'aresFlourish',
};

export const FlourishStoryFixture = {
  version: '1.0',
  provider_name: 'Flourish',
  provider_url: 'https://flourish.studio',
  html: '<iframe src="https://flo.uri.sh/story/2070814/embed" frameborder="0" scrolling="no" height="575" width="700" style="width:100%;" title="Interactive or visual content"></iframe>',
  width: 700,
  height: 575,
  type: 'rich',
  iFrameSrc: 'https://flo.uri.sh/story/2070814/embed?auto=1',
  iFrameId: 'flourish-id-b0be7f31',
  iFrameTitle: 'Interactive or visual content',
  sizeAdjustScript:
    "\n    window.addEventListener('message', function (event) {\n      var _message$src;\n      var message = typeof event.data === 'string' && JSON.parse(event.data);\n      if ((message === null || message === void 0 ? void 0 : message.sender) === 'Flourish' \n      && (message === null || message === void 0 ? void 0 : message.context) === 'iframe.resize' \n      && message !== null && message !== void 0 && (_message$src = message.src) !== null && _message$src !== void 0 && _message$src.includes('https://flo.uri.sh/story/2070814/embed?auto=1')) {\n        document.getElementById('flourish-id-b0be7f31').style.height = message.height + 'px';\n      }\n    });",
  source: 'https://public.flourish.studio/story/2070814',
  oEmbedType: 'aresFlourish',
};

export const FlourishVisualisationFixture = {
  version: '1.0',
  provider_name: 'Flourish',
  provider_url: 'https://flourish.studio',
  html: '<iframe src="https://flo.uri.sh/visualisation/15506675/embed" frameborder="0" scrolling="no" height="575" width="700" style="width:100%;" title="Interactive or visual content"></iframe>',
  width: 700,
  height: 575,
  type: 'rich',
  iFrameSrc: 'https://flo.uri.sh/visualisation/15506675/embed?auto=1',
  iFrameId: 'flourish-id-b59dd679',
  iFrameTitle: 'Interactive or visual content',
  sizeAdjustScript:
    "\n    window.addEventListener('message', function (event) {\n      var _message$src;\n      var message = typeof event.data === 'string' && JSON.parse(event.data);\n      if ((message === null || message === void 0 ? void 0 : message.sender) === 'Flourish' \n      && (message === null || message === void 0 ? void 0 : message.context) === 'iframe.resize' \n      && message !== null && message !== void 0 && (_message$src = message.src) !== null && _message$src !== void 0 && _message$src.includes('https://flo.uri.sh/visualisation/15506675/embed?auto=1')) {\n        document.getElementById('flourish-id-b59dd679').style.height = message.height + 'px';\n      }\n    });",
  source: 'https://public.flourish.studio/visualisation/15506675',
  oEmbedType: 'aresFlourish',
};