debian-mirror-gitlab/spec/javascripts/read_more_spec.js

24 lines
623 B
JavaScript
Raw Normal View History

2018-11-20 20:47:30 +05:30
import initReadMore from '~/read_more';
describe('Read more click-to-expand functionality', () => {
2019-05-18 00:54:41 +05:30
const fixtureName = 'projects/overview.html';
2018-11-20 20:47:30 +05:30
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);
});
});
});