23 lines
773 B
CoffeeScript
23 lines
773 B
CoffeeScript
moduleForModel 'section', 'Section model',
|
|
needs: ['model:section', 'model:table', 'model:section-area', 'model:section-element', 'model:list']
|
|
|
|
test "arrange_tables_in_grid", ->
|
|
section = @subject
|
|
width: 20
|
|
height: 13
|
|
Ember.run ->
|
|
table6 = section.store.createRecord 'table', number: 6, section: section
|
|
table1 = section.store.createRecord 'table', number: 1, section: section
|
|
table19 = section.store.createRecord 'table', number: 19, section: section
|
|
|
|
section.invoke 'arrange_tables_in_grid'
|
|
|
|
equal table1.get('position_y'), 2.85
|
|
equal table6.get('position_y'), 2.85
|
|
equal table19.get('position_y'), 9.35
|
|
|
|
equal table1.get('position_x'), 4.6
|
|
equal table6.get('position_x'), 14.6
|
|
equal table19.get('position_x'), 4.6
|
|
|