<commit_before>import {expect} from 'chai'
import Conditions from '../../lib/mixins/condition'

describe('Evaluating conditions', () => {
	let args = {
		Component: {
			props: {
				highlight: true,
				clicks: 20,
				noprop: undefined
			},
			state: {}
		}
	}
	
	//Separating mixin functions for better testing
	let equal, greater, unEqual, greaterThan, less, lessThan
	Conditions.forEach(mixin => {
		switch (mixin.key) {
			case '>=':
				greaterThan = mixin.fn
				break
			case '<=':
				lessThan = mixin.fn
				break
			case '>':
				greater = mixin.fn
				break
			case '<':
				less = mixin.fn
				break
			case '=':
				equal = mixin.fn
				break
			case '!=':
				unEqual = mixin.fn
				break
		}
	})
	
	it('should validate true', () => {
		expect(equal('highlight=true', true, args)).to.equal(true)
		expect(greater('clicks>10', true, args)).to.equal(true)
		expect(unEqual('clicks!=15', true, args)).to.equal(true)
		expect(greaterThan('clicks>=20', true, args)).to.equal(true)
		expect(greaterThan('clicks>=19', true, args)).to.equal(true)
		expect(equal('noprop=undefined', true, args)).to.equal(true)
		expect(unEqual('clicks!=undefined', true, args)).to.equal(true)
	})


	it('should validate false', () => {
		expect(less('clicks<10', true, args)).to.equal(false)
		expect(equal('border=2px', true, args)).to.equal(false)
		expect(unEqual('clicks!=20', true, args)).to.equal(false)
		expect(lessThan('clicks<=10', true, args)).to.equal(false)
		expect(equal('highlight=undefined', true, args)).to.equal(false)
	})
})<commit_msg>Failing test for null property<commit_after>import {expect} from 'chai'
import Conditions from '../../lib/mixins/condition'

describe('Evaluating conditions', () => {
	let args = {
		Component: {
			props: {
				highlight: true,
				clicks: 20,
				noprop: undefined,
				error: null
			},
			state: {}
		}
	}

	//Separating mixin functions for better testing
	let equal, greater, unEqual, greaterThan, less, lessThan
	Conditions.forEach(mixin => {
		switch (mixin.key) {
			case '>=':
				greaterThan = mixin.fn
				break
			case '<=':
				lessThan = mixin.fn
				break
			case '>':
				greater = mixin.fn
				break
			case '<':
				less = mixin.fn
				break
			case '=':
				equal = mixin.fn
				break
			case '!=':
				unEqual = mixin.fn
				break
		}
	})

	it('should validate true', () => {
		expect(equal('highlight=true', true, args)).to.equal(true)
		expect(greater('clicks>10', true, args)).to.equal(true)
		expect(unEqual('clicks!=15', true, args)).to.equal(true)
		expect(greaterThan('clicks>=20', true, args)).to.equal(true)
		expect(greaterThan('clicks>=19', true, args)).to.equal(true)
		expect(equal('noprop=undefined', true, args)).to.equal(true)
		expect(unEqual('clicks!=undefined', true, args)).to.equal(true)
		expect(equal('error=null', true, args)).to.equal(true)
	})


	it('should validate false', () => {
		expect(less('clicks<10', true, args)).to.equal(false)
		expect(equal('border=2px', true, args)).to.equal(false)
		expect(unEqual('clicks!=20', true, args)).to.equal(false)
		expect(lessThan('clicks<=10', true, args)).to.equal(false)
		expect(equal('highlight=undefined', true, args)).to.equal(false)
		expect(equal('error=undefined', true, args)).to.equal(false)
	})
})
{'fraction_non_alphanumeric': 0.18596059113300492, 'fraction_numerical': 0.010467980295566502, 'mean_word_length': 3.9452054794520546, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6486331', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1121, 'n_words': 218}