Skip to content

Commit

Permalink
Merge pull request #386 from girder/harden-test
Browse files Browse the repository at this point in the history
Modify the annotationListSpec test to make it more robust.
  • Loading branch information
manthey authored Oct 14, 2019
2 parents 341cf19 + b292813 commit 75a897d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions plugin_tests/client/annotationListSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@ describe('AnnotationListWidget', function () {
var id = $el.data('annotationId');
expect($el.find('.g-annotation-download').prop('href')).toMatch(new RegExp('.*annotation/' + id + '$'));
});
it('test permission editor link', function () {
var $el = $('.g-annotation-list .g-annotation-row:first');
expect($el.find('.g-annotation-permissions').length).toBe(1);
$el.find('.g-annotation-permissions').click();

girderTest.waitForDialog();
runs(function () {
expect($('#g-dialog-container .modal-title').text()).toBe('Access control');
$('#g-dialog-container .g-save-access-list').click();
});
girderTest.waitForLoad();
});
it('test delete link', function () {
var $el = $('.g-annotation-list .g-annotation-row:first');
var id = $el.data('annotationId');
Expand All @@ -206,17 +218,6 @@ describe('AnnotationListWidget', function () {
waitsFor(function () {
return $('.g-annotation-list .g-annotation-row[data-annotation-id="' + id + '"]').length === 0;
}, 'annotation to be removed');
});
it('test permission editor link', function () {
var $el = $('.g-annotation-list .g-annotation-row:first');
expect($el.find('.g-annotation-permissions').length).toBe(1);
$el.find('.g-annotation-permissions').click();

girderTest.waitForDialog();
runs(function () {
expect($('#g-dialog-container .modal-title').text()).toBe('Access control');
$('#g-dialog-container .g-save-access-list').click();
});
girderTest.waitForLoad();
});
});
Expand Down

0 comments on commit 75a897d

Please sign in to comment.