mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #26811 -- Added addButton option to admin inlines JavaScript.
This commit is contained in:
parent
52a991d976
commit
7ca6007bd2
3 changed files with 46 additions and 23 deletions
|
@ -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'));
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue