<commit_before>define([
  'client/preprocessors/visualisation_fallback'
], function (visualisationFallback) {
  describe('Module actions', function () {

    var originalModernizr = visualisationFallback.Modernizr;

    var el;
    beforeEach(function () {
      visualisationFallback.Modernizr = {};
      el = $('<div class="visualisation-inner" data-src="spec/client/preprocessors/transparent.gif">original content</div>');
      $('body').append(el);
    });

    afterEach(function () {
      visualisationFallback.Modernizr = originalModernizr;
      $('.visualisation-inner').remove();
    });

    it('does nothing when the browser supports SVG', function () {
      visualisationFallback.Modernizr.inlinesvg = true;
      visualisationFallback();
      expect(el.html()).toEqual('original content');
    });

    it('replaces the fallback container content with a fallback image', function () {
      visualisationFallback.Modernizr.inlinesvg = false;
      visualisationFallback();

      waitsFor(function () {
        return (el.html() !== 'original content');
      });

      runs(function () {
        expect(el.html()).toEqual('<img src="spec/client/preprocessors/transparent.gif">');
      });
    });
  });
});<commit_msg>Fix tests for image fallbacks<commit_after>define([
  'client/preprocessors/visualisation_fallback',
  'modernizr'
], function (visualisationFallback, Modernizr) {
  describe('Module actions', function () {

    var el;
    beforeEach(function () {
      el = $('<div class="visualisation-inner" data-src="spec/client/preprocessors/transparent.gif">original content</div>');
      $('body').append(el);
    });

    afterEach(function () {
      $('.visualisation-inner').remove();
    });

    it('does nothing when the browser supports SVG', function () {
      Modernizr.inlinesvg = true;
      visualisationFallback();
      expect(el.html()).toEqual('original content');
    });

    it('replaces the fallback container content with a fallback image', function () {
      Modernizr.inlinesvg = false;
      visualisationFallback();

      waitsFor(function () {
        return (el.html() !== 'original content');
      });

      runs(function () {
        expect(el.html()).toEqual('<img src="spec/client/preprocessors/transparent.gif">');
      });
    });
  });
});
{'fraction_non_alphanumeric': 0.15780371811500216, 'fraction_numerical': 0.0, 'mean_word_length': 3.458574181117534, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2765269', 'n_tokens_mistral': 687, 'n_tokens_neox': 658, 'n_words': 116}