From 14dc459c28a85e2d6b381f5b96295a6ed0485d65 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Wed, 31 Jul 2024 19:23:43 +0200 Subject: [PATCH 01/17] Add option to set html tag for dialog modal title --- ui/widgets/dialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/widgets/dialog.js b/ui/widgets/dialog.js index 756ad1cb10..fc096a192e 100644 --- a/ui/widgets/dialog.js +++ b/ui/widgets/dialog.js @@ -81,6 +81,7 @@ $.widget( "ui.dialog", { resizable: true, show: null, title: null, + uiDialogTitleTagName: "span", width: 300, // Callbacks @@ -437,7 +438,7 @@ $.widget( "ui.dialog", { } } ); - uiDialogTitle = $( "" ).uniqueId().prependTo( this.uiDialogTitlebar ); + uiDialogTitle = $( "<" + this.options.uiDialogTitleTagName + ">" ).uniqueId().prependTo( this.uiDialogTitlebar ); this._addClass( uiDialogTitle, "ui-dialog-title" ); this._title( uiDialogTitle ); From c22ba5bf0fc48f87762fffdd37c9ecc98d07f6ab Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Thu, 1 Aug 2024 03:46:04 +0200 Subject: [PATCH 02/17] Fix the line length lint error --- ui/widgets/dialog.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/widgets/dialog.js b/ui/widgets/dialog.js index fc096a192e..c8c5d39561 100644 --- a/ui/widgets/dialog.js +++ b/ui/widgets/dialog.js @@ -438,7 +438,9 @@ $.widget( "ui.dialog", { } } ); - uiDialogTitle = $( "<" + this.options.uiDialogTitleTagName + ">" ).uniqueId().prependTo( this.uiDialogTitlebar ); + uiDialogTitle = $( "<" + this.options.uiDialogTitleTagName + ">" ) + .uniqueId() + .prependTo( this.uiDialogTitlebar ); this._addClass( uiDialogTitle, "ui-dialog-title" ); this._title( uiDialogTitle ); From 564b79309ada566166ba774d46963d3b3a4a0728 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Thu, 1 Aug 2024 03:57:14 +0200 Subject: [PATCH 03/17] Add test to assert if the html tag is correctly set --- tests/unit/dialog/core.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js index c6bdec778c..cb0262aec6 100644 --- a/tests/unit/dialog/core.js +++ b/tests/unit/dialog/core.js @@ -117,6 +117,16 @@ QUnit.test( "aria-modal", function( assert ) { element.remove(); } ); +QUnit.test( "ui dialog title tagname", function( assert ) { + assert.expect( 1 ); + + var element, wrapper; + + element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: "h2" } ); + wrapper = document.querySelector( ".ui-dialog-title" ); + assert.equal( wrapper.tagName(), "h2", "The dialog title element is h2" ); +} ); + QUnit.test( "widget method", function( assert ) { assert.expect( 1 ); var dialog = $( "
" ).appendTo( "#qunit-fixture" ).dialog(); From 6f8307d7c9b85b05f8f4d2bbccb0d343fd98b038 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Thu, 1 Aug 2024 04:06:47 +0200 Subject: [PATCH 04/17] tagName is not a function. Removed parenthesis --- tests/unit/dialog/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js index cb0262aec6..40398bfeb6 100644 --- a/tests/unit/dialog/core.js +++ b/tests/unit/dialog/core.js @@ -124,7 +124,7 @@ QUnit.test( "ui dialog title tagname", function( assert ) { element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: "h2" } ); wrapper = document.querySelector( ".ui-dialog-title" ); - assert.equal( wrapper.tagName(), "h2", "The dialog title element is h2" ); + assert.equal( wrapper.tagName, "h2", "The dialog title element is h2" ); } ); QUnit.test( "widget method", function( assert ) { From 8f8c2a1b69b3a0c3b1abada4e350098cae5fba11 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Thu, 1 Aug 2024 04:22:33 +0200 Subject: [PATCH 05/17] add the missing tab for the second line of uiDialogTitle --- ui/widgets/dialog.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/widgets/dialog.js b/ui/widgets/dialog.js index c8c5d39561..5b94f7254a 100644 --- a/ui/widgets/dialog.js +++ b/ui/widgets/dialog.js @@ -439,8 +439,7 @@ $.widget( "ui.dialog", { } ); uiDialogTitle = $( "<" + this.options.uiDialogTitleTagName + ">" ) - .uniqueId() - .prependTo( this.uiDialogTitlebar ); + .uniqueId().prependTo( this.uiDialogTitlebar ); this._addClass( uiDialogTitle, "ui-dialog-title" ); this._title( uiDialogTitle ); From a277562e9dbed2c7117cee784ef78ff17a53dde3 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Thu, 1 Aug 2024 04:44:35 +0200 Subject: [PATCH 06/17] move the <> to the option --- ui/widgets/dialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/widgets/dialog.js b/ui/widgets/dialog.js index 5b94f7254a..3da2ed6b01 100644 --- a/ui/widgets/dialog.js +++ b/ui/widgets/dialog.js @@ -81,7 +81,7 @@ $.widget( "ui.dialog", { resizable: true, show: null, title: null, - uiDialogTitleTagName: "span", + uiDialogTitleTagName: "", width: 300, // Callbacks @@ -438,7 +438,7 @@ $.widget( "ui.dialog", { } } ); - uiDialogTitle = $( "<" + this.options.uiDialogTitleTagName + ">" ) + uiDialogTitle = $( this.options.uiDialogTitleTagName ) .uniqueId().prependTo( this.uiDialogTitlebar ); this._addClass( uiDialogTitle, "ui-dialog-title" ); this._title( uiDialogTitle ); From 9238fc032c88df943544f76f6da2ed6995ae1ba7 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Thu, 1 Aug 2024 04:45:45 +0200 Subject: [PATCH 07/17] adjust to the changes in dialog.js and set the option to

--- tests/unit/dialog/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js index 40398bfeb6..555c0ec8eb 100644 --- a/tests/unit/dialog/core.js +++ b/tests/unit/dialog/core.js @@ -122,7 +122,7 @@ QUnit.test( "ui dialog title tagname", function( assert ) { var element, wrapper; - element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: "h2" } ); + element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: "

" } ); wrapper = document.querySelector( ".ui-dialog-title" ); assert.equal( wrapper.tagName, "h2", "The dialog title element is h2" ); } ); From d4aa8a05b5ae105928a854c52e5c63beb8c0e44f Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Fri, 2 Aug 2024 02:20:42 +0200 Subject: [PATCH 08/17] fix for the test --- tests/unit/dialog/core.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js index 555c0ec8eb..6b9ec74e9b 100644 --- a/tests/unit/dialog/core.js +++ b/tests/unit/dialog/core.js @@ -120,11 +120,11 @@ QUnit.test( "aria-modal", function( assert ) { QUnit.test( "ui dialog title tagname", function( assert ) { assert.expect( 1 ); - var element, wrapper; + var element, nodeName; element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: "

" } ); - wrapper = document.querySelector( ".ui-dialog-title" ); - assert.equal( wrapper.tagName, "h2", "The dialog title element is h2" ); + nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get(0).nodeName.toLowerCase() + assert.equal (nodeName, "h2", "The dialog title element is h2" ); } ); QUnit.test( "widget method", function( assert ) { From b2f3e725fb9a7969af0e83d490384ce85cdd3783 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Fri, 2 Aug 2024 02:23:21 +0200 Subject: [PATCH 09/17] fix linting errors on the test --- tests/unit/dialog/core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js index 6b9ec74e9b..c821cdd161 100644 --- a/tests/unit/dialog/core.js +++ b/tests/unit/dialog/core.js @@ -123,8 +123,8 @@ QUnit.test( "ui dialog title tagname", function( assert ) { var element, nodeName; element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: "

" } ); - nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get(0).nodeName.toLowerCase() - assert.equal (nodeName, "h2", "The dialog title element is h2" ); + nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase(); + assert.equal ( nodeName, "h2", "The dialog title element is h2" ); } ); QUnit.test( "widget method", function( assert ) { From 7b9ea134ae78717f9f32f94cda3a0900b934eda3 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Fri, 2 Aug 2024 02:25:05 +0200 Subject: [PATCH 10/17] fix another linting error on the test --- tests/unit/dialog/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js index c821cdd161..41c7fa4aa3 100644 --- a/tests/unit/dialog/core.js +++ b/tests/unit/dialog/core.js @@ -124,7 +124,7 @@ QUnit.test( "ui dialog title tagname", function( assert ) { element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: "

" } ); nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase(); - assert.equal ( nodeName, "h2", "The dialog title element is h2" ); + assert.equal( nodeName, "h2", "The dialog title element is h2" ); } ); QUnit.test( "widget method", function( assert ) { From 478e434a6695a1eb7c17ba5d748d5744261a7a77 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Fri, 2 Aug 2024 02:37:27 +0200 Subject: [PATCH 11/17] add new option to common.js and common-deprecated.js --- tests/unit/dialog/common-deprecated.js | 1 + tests/unit/dialog/common.js | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/unit/dialog/common-deprecated.js b/tests/unit/dialog/common-deprecated.js index 1efdcb0301..f961bbb4f5 100644 --- a/tests/unit/dialog/common-deprecated.js +++ b/tests/unit/dialog/common-deprecated.js @@ -34,6 +34,7 @@ common.testWidget( "dialog", { resizable: true, show: null, title: null, + uiDialogTitleTagName: "", width: 300, // Callbacks diff --git a/tests/unit/dialog/common.js b/tests/unit/dialog/common.js index c8d885ad03..6357bf7e8f 100644 --- a/tests/unit/dialog/common.js +++ b/tests/unit/dialog/common.js @@ -33,6 +33,7 @@ common.testWidget( "dialog", { resizable: true, show: null, title: null, + uiDialogTitleTagName: "", width: 300, // Callbacks From 140fa736ea499167dbd59a14369714ec82c0accb Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Tue, 6 Aug 2024 00:30:12 +0200 Subject: [PATCH 12/17] use and accept integer values only for html element --- ui/widgets/dialog.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/widgets/dialog.js b/ui/widgets/dialog.js index 3da2ed6b01..e3accf6593 100644 --- a/ui/widgets/dialog.js +++ b/ui/widgets/dialog.js @@ -81,7 +81,7 @@ $.widget( "ui.dialog", { resizable: true, show: null, title: null, - uiDialogTitleTagName: "", + uiDialogTitleHeadingLevel: 0, width: 300, // Callbacks @@ -438,8 +438,12 @@ $.widget( "ui.dialog", { } } ); - uiDialogTitle = $( this.options.uiDialogTitleTagName ) - .uniqueId().prependTo( this.uiDialogTitlebar ); + var uiDialogHeadingLevel = Number.isInteger( this.options.uiDialogTitleHeadingLevel ) + && this.options.uiDialogTitleHeadingLevel > 0 + && this.options.uiDialogTitleHeadingLevel <= 6 + ? "h" + this.options.uiDialogTitleHeadingLevel : "span"; + + uiDialogTitle = $( "<" + uiDialogHeadingLevel + ">" ).uniqueId().prependTo( this.uiDialogTitlebar ); this._addClass( uiDialogTitle, "ui-dialog-title" ); this._title( uiDialogTitle ); From f46ff12ea0aa61dbdf2e3e2a623cce1df5e7281e Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Tue, 6 Aug 2024 00:31:00 +0200 Subject: [PATCH 13/17] Add new tests for dialog title heading levels --- tests/unit/dialog/core.js | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js index 41c7fa4aa3..0c39423f59 100644 --- a/tests/unit/dialog/core.js +++ b/tests/unit/dialog/core.js @@ -117,14 +117,38 @@ QUnit.test( "aria-modal", function( assert ) { element.remove(); } ); -QUnit.test( "ui dialog title tagname", function( assert ) { - assert.expect( 1 ); +QUnit.test( "ui dialog title heading level", function( assert ) { + assert.expect( 7 ); var element, nodeName; - element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: "

" } ); + element = $( "
" ).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" ); + + element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: 0 } ); + nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase(); + assert.equal( nodeName, "span", "The dialog title element is span" ); + + element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: 1 } ); + nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase(); + assert.equal( nodeName, "h1", "The dialog title element is h1" ); + + element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: 6 } ); + nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase(); + assert.equal( nodeName, "h6", "The dialog title element is h6" ); + + element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: 9 } ); + nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase(); + assert.equal( nodeName, "span", "The dialog title element is span" ); + + element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: -9 } ); + nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase(); + assert.equal( nodeName, "span", "The dialog title element is span" ); + + element = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: 2.3 } ); nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase(); - assert.equal( nodeName, "h2", "The dialog title element is h2" ); + assert.equal( nodeName, "span", "The dialog title element is span" ); } ); QUnit.test( "widget method", function( assert ) { From 6ffab2e8270a7655862b672476019bc1337b7720 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Tue, 6 Aug 2024 00:32:09 +0200 Subject: [PATCH 14/17] change to the new default value 0 for uiDialogTitleHeadingLevel --- tests/unit/dialog/common-deprecated.js | 2 +- tests/unit/dialog/common.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/dialog/common-deprecated.js b/tests/unit/dialog/common-deprecated.js index f961bbb4f5..2cdae9681d 100644 --- a/tests/unit/dialog/common-deprecated.js +++ b/tests/unit/dialog/common-deprecated.js @@ -34,7 +34,7 @@ common.testWidget( "dialog", { resizable: true, show: null, title: null, - uiDialogTitleTagName: "", + uiDialogTitleHeadingLevel: 0, width: 300, // Callbacks diff --git a/tests/unit/dialog/common.js b/tests/unit/dialog/common.js index 6357bf7e8f..f311810476 100644 --- a/tests/unit/dialog/common.js +++ b/tests/unit/dialog/common.js @@ -33,7 +33,7 @@ common.testWidget( "dialog", { resizable: true, show: null, title: null, - uiDialogTitleTagName: "", + uiDialogTitleHeadingLevel: 0, width: 300, // Callbacks From 5652776e6eea4f9b13afeab80e09f8802c485a28 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Tue, 6 Aug 2024 00:34:57 +0200 Subject: [PATCH 15/17] fix linting errors --- ui/widgets/dialog.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ui/widgets/dialog.js b/ui/widgets/dialog.js index e3accf6593..1ef2fa3d6f 100644 --- a/ui/widgets/dialog.js +++ b/ui/widgets/dialog.js @@ -438,12 +438,13 @@ $.widget( "ui.dialog", { } } ); - var uiDialogHeadingLevel = Number.isInteger( this.options.uiDialogTitleHeadingLevel ) - && this.options.uiDialogTitleHeadingLevel > 0 - && this.options.uiDialogTitleHeadingLevel <= 6 - ? "h" + this.options.uiDialogTitleHeadingLevel : "span"; + var uiDialogHeadingLevel = Number.isInteger( this.options.uiDialogTitleHeadingLevel ) && + this.options.uiDialogTitleHeadingLevel > 0 && + this.options.uiDialogTitleHeadingLevel <= 6 ? + "h" + this.options.uiDialogTitleHeadingLevel : "span"; - uiDialogTitle = $( "<" + uiDialogHeadingLevel + ">" ).uniqueId().prependTo( this.uiDialogTitlebar ); + uiDialogTitle = $( "<" + uiDialogHeadingLevel + ">" ) + .uniqueId().prependTo( this.uiDialogTitlebar ); this._addClass( uiDialogTitle, "ui-dialog-title" ); this._title( uiDialogTitle ); From c70786d9285dde6678e4c1152fde41e969e00778 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Tue, 6 Aug 2024 00:44:33 +0200 Subject: [PATCH 16/17] fix dialog title heading level tests --- tests/unit/dialog/core.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js index 0c39423f59..be97118ab3 100644 --- a/tests/unit/dialog/core.js +++ b/tests/unit/dialog/core.js @@ -124,31 +124,31 @@ QUnit.test( "ui dialog title heading level", function( assert ) { element = $( "
" ).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 = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: 0 } ); + element = $( "
" ).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 = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: 1 } ); + element = $( "
" ).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 = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: 6 } ); + element = $( "
" ).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 = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: 9 } ); + element = $( "
" ).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 = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: -9 } ); + element = $( "
" ).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 = $( "
" ).dialog( { modal: true, uiDialogTitleTagName: 2.3 } ); + element = $( "
" ).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 ) { From 8f583cbfad5c3931d511263c504bd32b34a97c33 Mon Sep 17 00:00:00 2001 From: Ralf Koller Date: Tue, 6 Aug 2024 00:59:08 +0200 Subject: [PATCH 17/17] add another assertion for the dialog title heading lvl with option foo --- tests/unit/dialog/core.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js index be97118ab3..a8cc9678e5 100644 --- a/tests/unit/dialog/core.js +++ b/tests/unit/dialog/core.js @@ -118,7 +118,7 @@ QUnit.test( "aria-modal", function( assert ) { } ); QUnit.test( "ui dialog title heading level", function( assert ) { - assert.expect( 7 ); + assert.expect( 8 ); var element, nodeName; @@ -149,6 +149,10 @@ QUnit.test( "ui dialog title heading level", function( assert ) { element = $( "
" ).dialog( { modal: true, uiDialogTitleHeadingLevel: 2.3 } ); nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase(); assert.equal( nodeName, "span", "Element wrapping the dialog title is span" ); + + element = $( "
" ).dialog( { modal: true, uiDialogTitleHeadingLevel: "foo" } ); + nodeName = element.dialog( "widget" ).find( ".ui-dialog-title" ).get( 0 ).nodeName.toLowerCase(); + assert.equal( nodeName, "span", "Element wrapping the dialog title is span" ); } ); QUnit.test( "widget method", function( assert ) {