Skip to content

Instantly share code, notes, and snippets.

View niinpatel's full-sized avatar
💭
goofing off

Nitin Patel niinpatel

💭
goofing off
View GitHub Profile
test('should update the value when onChange is called', () => {
nameField.onChange({ target: { value: 'nitin' } });
expect(nameField.value).toBe('nitin');
});
test('should update the value when onChange is called', () => {
act(() => {
nameField.onChange({ target: { value: 'nitin' } });
});
expect(nameField.value).toBe('nitin');
});
breakingRecords :: [Int] -> [Int]
updateMinMax [maxRec,minRec,max, min] score =
[newMaxRec,newMinRec,newMax,newMin]
where
newMax = if score > max then score else max
newMin = if score < min then score else min
newMaxRec = if newMax > max then (maxRec + 1) else maxRec
newMinRec = if newMin < min then (minRec + 1) else minRec