mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 00:28:31 -05:00
2855d2a402
Made conflict finding a bit more liberal, in that any messing with arrays (adding, removing or moving things inside) will conflict with any other such change.
18 lines
No EOL
612 B
CoffeeScript
18 lines
No EOL
612 B
CoffeeScript
deltas = require 'lib/deltas'
|
|
|
|
describe 'deltas lib', ->
|
|
|
|
describe 'getConflicts', ->
|
|
|
|
it 'handles conflicts where one change conflicts with several changes', ->
|
|
originalData = {list:[1,2,3]}
|
|
forkA = {list:['1', 2, '3']}
|
|
forkB = {noList: '...'}
|
|
differ = deltas.makeJSONDiffer()
|
|
|
|
expandedDeltaA = deltas.expandDelta(differ.diff originalData, forkA)
|
|
expandedDeltaB = deltas.expandDelta(differ.diff originalData, forkB)
|
|
deltas.getConflicts(expandedDeltaA, expandedDeltaB)
|
|
for delta in expandedDeltaA
|
|
expect(delta.conflict).toBeDefined()
|
|
|