<commit_before>import Vue from 'vue';
import PhotoCard from '@/components/PhotoCard';

describe('PhotoCard.vue', () => {
  let component;
  let photo;

  beforeEach(() => {
    photo = {
      imgLink: 'webf',
      dropboxId: '45',
    };
    const Constructor = Vue.extend(PhotoCard);
    component = new Constructor({
      propsData: {
        photo,
      },
    }).$mount();
  });

  it('should be named "PhotoCard"', () => {
    expect(component.$options.name).to.equal('PhotoCard');
  });

  describe('render', () => {
    it.only('should render photo image', () => Vue.nextTick().then(() => {
      const photoLink = component.$el.querySelector('img');
      expect(photoLink.getAttribute('src')).to.equal('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
      expect(photoLink.getAttribute('lazy')).to.equal('loading');
    }));

    // Comment tester le lazy load ?
    it.skip('should render photo image', () => Vue.nextTick().then(() => {
      const photoLink = component.$el.querySelector('img');

      // return Vue.nextTick().then(() => {
      console.log(photoLink);
      expect(photoLink.getAttribute('lazy')).to.equal('loaded');
      expect(photoLink.getAttribute('src')).to.contain('webf');
      // });
    }));
  });
<commit_msg>review(REC-55) : remove only<commit_after>import Vue from 'vue';
import PhotoCard from '@/components/PhotoCard';

describe('PhotoCard.vue', () => {
  let component;
  let photo;

  beforeEach(() => {
    photo = {
      imgLink: 'webf',
      dropboxId: '45',
    };
    const Constructor = Vue.extend(PhotoCard);
    component = new Constructor({
      propsData: {
        photo,
      },
    }).$mount();
  });

  it('should be named "PhotoCard"', () => {
    expect(component.$options.name).to.equal('PhotoCard');
  });

  describe('render', () => {
    it('should render photo image', () => Vue.nextTick().then(() => {
      const photoLink = component.$el.querySelector('img');
      expect(photoLink.getAttribute('src')).to.equal('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
      expect(photoLink.getAttribute('lazy')).to.equal('loading');
    }));

    // Comment tester le lazy load ?
    it.skip('should render photo image', () => Vue.nextTick().then(() => {
      const photoLink = component.$el.querySelector('img');

      // return Vue.nextTick().then(() => {
      console.log(photoLink);
      expect(photoLink.getAttribute('lazy')).to.equal('loaded');
      expect(photoLink.getAttribute('src')).to.contain('webf');
      // });
    }));
  });

{'fraction_non_alphanumeric': 0.1972972972972973, 'fraction_numerical': 0.006177606177606178, 'mean_word_length': 3.3183333333333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '6954884', 'n_tokens_mistral': 832, 'n_tokens_neox': 832, 'n_words': 126}