import { expect }                               from 'chai';
import React                                    from 'react';
import { isBarrierSupported, barriersToString } from '../barriers';

describe('Barriers', () => {
    describe('isBarrierSupported', () => {
        it('should return false when barrier is not in CONTRACT_SHADES', () => {
            expect(isBarrierSupported('SomeThinMadeUp')).to.eql(false);
        });
        it('should return true when barrier is in CONTRACT_SHADES', () => {
            expect(isBarrierSupported('CALL')).to.eql(true);
        });
    });

    describe('barriersToString', () => {
        it('should convert non-zero barriers which do not have +/- to string consisting of them without +/-', () => {
            expect(barriersToString(false, [10, 15])).to.deep.eql(['10','15']);
        });
        it('should convert values with +/- to string consisting of them with +/-', () => {
            expect(barriersToString(false, [0, 15])).to.deep.eql(['0','15']);
        });
        it('should convert barriers which do not have +/- to string consisting of them without +/-', () => {
            expect(barriersToString(false, [+11, 15])).to.deep.eql(['11','15']);
        });
        it('should convert barriers which do not have +/- to string consisting of them with +/- while is_relative is true', () => {
            expect(barriersToString(true, [+11, +15])).to.deep.eql(['+11','+15']);
        });
    });
});
@@ -720,32 +720,59 @@
 them without +/-
+ while is_relative is false
 ', () =%3E %7B%0A     
@@ -896,20 +896,32 @@
 ues with
+out
  +/-
+ and zero
  to stri
@@ -946,20 +946,50 @@
 hem with
+out
  +/-
+ while is_relative is false
 ', () =%3E
@@ -1115,39 +1115,32 @@
  barriers which 
-do not 
 have +/- to stri
@@ -1172,16 +1172,43 @@
 hout +/-
+ while is_relative is false
 ', () =%3E
@@ -1337,39 +1337,32 @@
  barriers which 
-do not 
 have +/- to stri

fix test descriptions