Welcome to mirror list, hosted at ThFree Co, Russian Federation.

read_more_spec.js « javascripts « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d1d012724030f08f212f8379137e8b4b3a6931b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import initReadMore from '~/read_more';

describe('Read more click-to-expand functionality', () => {
  const fixtureName = 'projects/overview.html';

  preloadFixtures(fixtureName);

  beforeEach(() => {
    loadFixtures(fixtureName);
  });

  describe('expands target element', () => {
    it('adds "is-expanded" class to target element', () => {
      const target = document.querySelector('.read-more-container');
      const trigger = document.querySelector('.js-read-more-trigger');
      initReadMore();

      trigger.click();

      expect(target.classList.contains('is-expanded')).toEqual(true);
    });
  });
});