1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #34995 -- Improved position of related widget's add link on admin pages on small screens.

Regression in 1699f8b52a.

Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
Co-authored-by: Natalia Bidart <124304+nessita@users.noreply.github.com>
This commit is contained in:
Tom Carrick
2023-11-23 17:37:37 +01:00
committed by Natalia
parent af2fd36815
commit 999ba9db6d
5 changed files with 27 additions and 45 deletions

View File

@@ -5,9 +5,13 @@ QUnit.module('admin.SelectFilter2');
QUnit.test('init', function(assert) {
const $ = django.jQuery;
$('<form><select id="id"></select></form>').appendTo('#qunit-fixture');
$('<option value="0">A</option>').appendTo('#id');
$('<form id="test"></form>').appendTo('#qunit-fixture');
$('<label for="id_id">Test</label>').appendTo('#test');
$('<div class="helptext">This is helpful.</div>').appendTo('#test');
$('<select id="id"><option value="0">A</option></select>').appendTo('#test');
SelectFilter.init('id', 'things', 0);
assert.equal($('#test').children().first().prop("tagName"), "DIV");
assert.equal($('#test').children().first().attr("class"), "selector");
assert.equal($('.selector-available h2').text().trim(), "Available things");
assert.equal($('.selector-chosen h2').text().trim(), "Chosen things");
assert.equal($('.selector-chosen select')[0].getAttribute('multiple'), '');