The code powering m.abunchtell.com https://m.abunchtell.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

31 satır
1.1 KiB

  1. import { expect } from 'chai';
  2. import { mount } from 'enzyme';
  3. import sinon from 'sinon';
  4. import React from 'react';
  5. import Column from '../../../../../../app/javascript/mastodon/features/ui/components/column';
  6. import ColumnHeader from '../../../../../../app/javascript/mastodon/features/ui/components/column_header';
  7. describe('<Column />', () => {
  8. describe('<ColumnHeader /> click handler', () => {
  9. beforeEach(() => {
  10. global.requestAnimationFrame = sinon.spy();
  11. });
  12. it('runs the scroll animation if the column contains scrollable content', () => {
  13. const wrapper = mount(
  14. <Column heading='notifications'>
  15. <div className='scrollable' />
  16. </Column>
  17. );
  18. wrapper.find(ColumnHeader).simulate('click');
  19. expect(global.requestAnimationFrame.called).to.equal(true);
  20. });
  21. it('does not try to scroll if there is no scrollable content', () => {
  22. const wrapper = mount(<Column heading='notifications' />);
  23. wrapper.find(ColumnHeader).simulate('click');
  24. expect(global.requestAnimationFrame.called).to.equal(false);
  25. });
  26. });
  27. });