diff options
| author | David Sanders <dsanders11@ucsbalum.com> | 2016-06-28 12:19:53 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-06-28 15:19:53 -0400 |
| commit | 7ca6007bd2cfb69e88704e8e9a6de17866581b0a (patch) | |
| tree | 0ced573507e1474a025d8fbd1d2922cad14f85eb /js_tests/admin/inlines.test.js | |
| parent | 52a991d9766de08b411ee05e2166ed9576da3458 (diff) | |
Fixed #26811 -- Added addButton option to admin inlines JavaScript.
Diffstat (limited to 'js_tests/admin/inlines.test.js')
| -rw-r--r-- | js_tests/admin/inlines.test.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/js_tests/admin/inlines.test.js b/js_tests/admin/inlines.test.js index d4c642ec40..b18b266024 100644 --- a/js_tests/admin/inlines.test.js +++ b/js_tests/admin/inlines.test.js @@ -51,3 +51,21 @@ test('add/remove form events', function(assert) { }); deleteLink.click(); }); + +test('existing add button', function(assert) { + var $ = django.jQuery; + $('#qunit-fixture').empty(); // Clear the table added in beforeEach + $('#qunit-fixture').append($('#tabular-formset').text()); + this.table = $('table.inline'); + this.inlineRow = this.table.find('tr'); + this.table.append('<i class="add-button"></i>'); + var addButton = this.table.find('.add-button'); + this.inlineRow.tabularFormset({ + prefix: 'first', + deleteText: 'Remove', + addButton: addButton + }); + assert.equal(this.table.find('.add-row a').length, 0); + addButton.click(); + assert.ok(this.table.find('#first-1').hasClass('row2')); +}); |
