Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* eslint-env node, mocha */
- /* global expect */
- /* eslint no-console: 0 */
- 'use strict';
- // Uncomment the following lines to use the react test utilities
- import React from 'react';
- import {mount} from 'enzyme';
- import {observable} from 'mobx';
- import {observer} from 'mobx-react';
- @observer
- class Observer extends React.Component {
- render() {
- this.props.fields[this.props.name].indexOf('');
- return false;
- }
- }
- describe.only('Function push ref', () => {
- const fields = observable({
- colors: []
- });
- const realpush = fields.colors.push;
- console.log(`actual push: ${realpush.toString()}`);
- mount(
- <span>
- <Observer fields={fields} name='colors'/>
- <Observer fields={fields} name='colors'/>
- </span>
- );
- it('should not change push prototype.', ()=>{
- let push = fields.colors.push.toString();
- console.log(`current push: ${push}`)
- expect(push).to.not.contain('predicate');
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement