Beispiel #1
0
 it('при нажатие на старт вызывается setAnimationFlag и в неё передаёться true', () => {
   animationFlag = false
   let player = testTree(<Player points={points} animationFlag={animationFlag} setAnimationFlag={setAnimationFlag} />)
   
   player.get('startButton').click()
   expect(animationFlag).to.be.true
 })
Beispiel #2
0
 it('при нажатие на стоп вызывается setAnimationFlag и в неё передаёться false', () => {
   animationFlag = true
   let drawChart = () => {}
   let player = testTree(<Player points={points} animationFlag={animationFlag} setAnimationFlag={setAnimationFlag} drawChart={drawChart} />)
   
   player.get('stopButton').click()
   expect(animationFlag).to.be.false
 })
Beispiel #3
0
  it('добавление точек при клике на рабочей области', () => {
    const graph = ShallowTestUtils.findWithType( editor, Graph )
    const graphTree = testTree( graph )

    for (let i = 1; i <= 5; i++) {
      graphTree.get('svg').click()
      expect(graph.props.points().length).to.equal(i)
    }  
  })
        before(() => {
            expect(PrefetchExample)
                .itself.to.have.property("WrappedComponent");

            expect(PrefetchExample.WrappedComponent).to.exist;

            prefetchExampleTree = testTree(
                <PrefetchExample />
            );
        });
Beispiel #5
0
  describe('Если есть данные и флаг анимации включён, то можно отключить анимацию', () => {
    let animationFlag = true
    let player = testTree(<Player points={points} animationFlag={animationFlag} />)

    it('включить анимацию нельзя', () => {
      expect(player.get('startButton').getProp('disabled')).to.equal('disabled')
    })
    it('можно выключить анимацию', () => {
      expect(player.get('stopButton').getProp('disabled')).to.be.false
    })
  })
Beispiel #6
0
  describe('Если точек нет, то кнопки отключены', () => {
    let player = testTree(<Player points={points} animationFlag={animationFlag} />)

    it('включить анимацию нельзя', () => {
      expect(player.get('startButton').getProp('disabled')).to.equal('disabled')
    })

    it('выключить анимацию нельзя', () => {
      expect(player.get('stopButton').getProp('disabled')).to.equal('disabled')
    })
  })
 beforeEach(() => {
   clickLine = sinon.stub();
   app = createApplication(Application, {
     stub: {
       codeActionCreators: {
         clickLine: clickLine
       }
     }
   });
   childContent = 'This is the content';
   element = testTree(<Clickable children={childContent}/>, {
     context: { app : app }
   });
 });
Beispiel #8
0
  it('генерация нового цвета для новой точки', () => {
    let _points = []
    let points = (point = false, callBack = () => {}) => {
      if (point) _points.push(point)
      callBack()
      return _points
    } 
    const handleChangeColor = sinon.spy()

    testTree(
      <Graph  
        points={points} 
        color={'#000000'}
        number={2}
        handleChangeColor={handleChangeColor} 
      />
    ).get('svg').click()

    expect(handleChangeColor.called).to.be.true
  })
 const errorRender = () => testTree(
     <ErrorExample />
 );