10000 Dialog: Add option to put the dialog title in a header element by rpkoller · Pull Request #2275 · jquery/jquery-ui · GitHub
[go: up one dir, main page]

Skip to content

Dialog: Add option to put the dialog title in a header element #2275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix dialog title heading level tests
  • Loading branch information
rpkoller committed Aug 5, 2024
commit c70786d9285dde6678e4c1152fde41e969e00778
26 changes: 13 additions & 13 deletions tests/unit/dialog/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,31 +124,31 @@ QUnit.test( "ui dialog title heading level", function( assert ) {

element = $( "<div>" ).dialog( { modal: true } );
nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase();
assert.equal( nodeName, "span", "The dialog title element is span" );
assert.equal( nodeName, "span", "Element wrapping the dialog title is span" );

element = $( "<div>" ).dialog( { modal: true, uiDialogTitleTagName: 0 } );
element = $( "<div>" ).dialog( { modal: true, uiDialogTitleHeadingLevel: 0 } );
nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase();
assert.equal( nodeName, "span", "The dialog title element is span" );
assert.equal( nodeName, "span", "Element wrapping the dialog title is span" );

element = $( "<div>" ).dialog( { modal: true, uiDialogTitleTagName: 1 } );
element = $( "<div>" ).dialog( { modal: true, uiDialogTitleHeadingLevel: 1 } );
nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase();
assert.equal( nodeName, "h1", "The dialog title element is h1" );
assert.equal( nodeName, "h1", "Element wrapping the dialog title is h1" );

element = $( "<div>" ).dialog( { modal: true, uiDialogTitleTagName: 6 } );
element = $( "<div>" ).dialog( { modal: true, uiDialogTitleHeadingLevel: 6 } );
nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase();
assert.equal( nodeName, "h6", "The dialog title element is h6" );
assert.equal( nodeName, "h6", "Element wrapping the dialog title is h6" );

element = $( "<div>" ).dialog( { modal: true, uiDialogTitleTagName: 9 } );
element = $( "<div>" ).dialog( { modal: true, uiDialogTitleHeadingLevel: 9 } );
nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase();
assert.equal( nodeName, "span", "The dialog title element is span" );
assert.equal( nodeName, "span", "Element wrapping the dialog title is span" );

element = $( "<div>" ).dialog( { modal: true, uiDialogTitleTagName: -9 } );
element = $( "<div>" ).dialog( { modal: true, uiDialogTitleHeadingLevel: -9 } );
nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase();
assert.equal( nodeName, "span", "The dialog title element is span" );
assert.equal( nodeName, "span", "Element wrapping the dialog title is span" );

element = $( "<div>" ).dialog( { modal: true, uiDialogTitleTagName: 2.3 } );
element = $( "<div>" ).dialog( { modal: true, uiDialogTitleHeadingLevel: 2.3 } );
nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase();
assert.equal( nodeName, "span", "The dialog title element is span" );
assert.equal( nodeName, "span", "Element wrapping the dialog title is span" );
} );

QUnit.test( "widget method", function( assert ) {
Expand Down
0