Code Duplication    Length = 18-21 lines in 2 locations

skins/cat17/src/app/tests/reducers/test_input_validation.js 2 locations

@@ 104-124 (lines=21) @@
101
		},
102
		expectedState = {
103
			iban: { dataEntered: true, isValid: true },
104
			bic: { dataEntered: false, isValid: null },
105
			accountNumber: { dataEntered: false, isValid: null },
106
			bankCode: { dataEntered: false, isValid: null }
107
		};
108
109
	deepFreeze( stateBefore );
110
	t.deepEqual( inputValidation( stateBefore, newBankDataValidationAction( {
111
		status: 'OK',
112
		iban: 'DE12500105170648489890'
113
	} ) ), expectedState );
114
	t.end();
115
} );
116
117
test( 'If bank data validation fails, all fields retrieve invalid status', function ( t ) {
118
	var stateBefore = {
119
			iban: { dataEntered: false, isValid: null },
120
			bic: { dataEntered: false, isValid: null },
121
			accountNumber: { dataEntered: false, isValid: null },
122
			bankCode: { dataEntered: false, isValid: null }
123
		},
124
		expectedState = {
125
			iban: { dataEntered: true, isValid: false },
126
			bic: { dataEntered: true, isValid: false },
127
			accountNumber: { dataEntered: true, isValid: false },
@@ 126-143 (lines=18) @@
123
		},
124
		expectedState = {
125
			iban: { dataEntered: true, isValid: false },
126
			bic: { dataEntered: true, isValid: false },
127
			accountNumber: { dataEntered: true, isValid: false },
128
			bankCode: { dataEntered: true, isValid: false }
129
		};
130
131
	deepFreeze( stateBefore );
132
	t.deepEqual( inputValidation( stateBefore, newBankDataValidationAction( { status: 'ERR' } ) ), expectedState );
133
	t.end();
134
} );
135
136
test( 'If address data validation is successful, related fields retrieve valid status', function ( t ) {
137
	var stateBefore = {
138
			firstName: { dataEntered: true, isValid: null },
139
			lastName: { dataEntered: true, isValid: null },
140
			street: { dataEntered: true, isValid: null },
141
			city: { dataEntered: true, isValid: null },
142
			postcode: { dataEntered: true, isValid: null },
143
			email: { dataEntered: true, isValid: null },
144
			iAmUnrelated: { dataEntered: true, isValid: null }
145
		},
146
		expectedState = {