Closed DinisCruz closed 8 years ago
Here is a variation of the test that proves the problem (using the view's test)
describe 'views | table.page', ->
project = 'bsimm'
team = 'team-A'
options =
project : project
team : team
url_Location : "/view/#{project}/#{team}/table"
url_Template_Key: 'pages/table.page.html'
view = null
beforeEach ()->
module('MM_Graph')
inject ($injector, $httpBackend)->
using ($httpBackend),->
@.expectGET("/api/v1/project/schema/#{project}" ).respond({});
@.expectGET("/api/v1/project/schema/#{project}" ).respond({});
@.expectGET("/api/v1/project/schema/#{project}" ).respond({});
@.expectGET("/api/v1/data/#{project}/#{team}/score").respond({});
@.expectGET("/api/v1/data/#{project}/#{team}/score").respond({});
@.expectGET("/api/v1/data/#{project}/#{team}/score").respond({});
@.expectGET("/api/v1/team/#{project}/get/#{team}" ).respond({});
@.expectGET("/api/v1/team/#{project}/get/#{team}" ).respond({});
@.expectGET("/api/v1/team/#{project}/get/#{team}" ).respond({});
view = $injector.get('Render_View')(options).run()
it 'pages/table.page.html', ->
using view, ->
@.$('teamMenu').length.assert_Is 1
@.$('teamTable').length.assert_Is 3
Fixed, here is the regression test that proves the fix
describe 'views | table.page', ->
project = 'bsimm'
team = 'team-A'
options =
project : project
team : team
url_Location : "/view/#{project}/#{team}/table"
url_Template_Key: 'pages/table.page.html'
view = null
beforeEach ()->
module('MM_Graph')
inject ($injector, $httpBackend)->
using ($httpBackend),->
@.expectGET("/api/v1/project/schema/#{project}" )
#@.expectGET("/api/v1/project/schema/#{project}" ) # throws error after fix
#@.expectGET("/api/v1/project/schema/#{project}" )
@.expectGET("/api/v1/data/#{project}/#{team}/score")
@.expectGET("/api/v1/team/#{project}/get/#{team}" )
view = $injector.get('Render_View')(options).run()
it 'pages/table.page.html', ->
using view, ->
@.$('teamMenu' ).length.assert_Is 1
@.$('teamTable').length.assert_Is 3
@.$('.callout' ).length.assert_Is 3
@.$('table' ).length.assert_Is 3 # tables
@.$('th' ).length.assert_Is 33 # table headers
@.$('tr' ).length.assert_Is 115 # rows
@.$('td' ).length.assert_Is 1232 # cells
here is the proof that we don't get more than 3 requests send (with no duplication)
and
This is caused by the use of the activity-table directive 3 times
Test that proves it