@@ -104,6 +104,72 @@ describe("The ui5-language-assistant xml-views-completion", () => {
104104 } ) ;
105105 } ) ;
106106
107+ context ( "sap.ui.core.FragmentDefinition content" , ( ) => {
108+ context ( "no prefix" , ( ) => {
109+ it ( "will suggest **all** Controls" , ( ) => {
110+ const xmlSnippet = `
111+ <core:FragmentDefinition xmlns:core="sap.ui.core">
112+ <⇶
113+ </core:FragmentDefinition>
114+ ` ;
115+
116+ testSuggestionsScenario ( {
117+ context : appContext ,
118+ xmlText : xmlSnippet ,
119+ providers : {
120+ elementName : [ classesSuggestions ] ,
121+ } ,
122+ assertion : ( suggestions ) => {
123+ const baseControl = ui5Model . classes [ "sap.ui.core.Control" ] ;
124+ expect ( suggestions ) . to . have . length . greaterThan ( 200 ) ;
125+ forEach ( suggestions , ( _ ) => {
126+ expect ( _ . ui5Node . kind ) . to . equal ( "UI5Class" ) ;
127+ const superClasses = getSuperClasses ( _ . ui5Node as UI5Class ) ;
128+ // Chai's `.include` is super slow, we must implement it ourselves...
129+ const doesSuggestionExtendsControl =
130+ find ( superClasses , baseControl ) !== undefined ;
131+ expect (
132+ doesSuggestionExtendsControl || _ . ui5Node === baseControl
133+ ) . to . be . true ;
134+ } ) ;
135+ } ,
136+ } ) ;
137+ } ) ;
138+ } ) ;
139+ context ( "multiple children" , ( ) => {
140+ it ( "will suggest **all** Controls" , ( ) => {
141+ const xmlSnippet = `
142+ <core:FragmentDefinition xmlns:core="sap.ui.core" xmlns="sap.m">
143+ <Button></Button>
144+ <⇶
145+ </core:FragmentDefinition>
146+ ` ;
147+
148+ testSuggestionsScenario ( {
149+ context : appContext ,
150+ xmlText : xmlSnippet ,
151+ providers : {
152+ elementName : [ classesSuggestions ] ,
153+ } ,
154+ assertion : ( suggestions ) => {
155+ const baseControl = ui5Model . classes [ "sap.ui.core.Control" ] ;
156+ expect ( suggestions ) . to . have . length . greaterThan ( 200 ) ;
157+ forEach ( suggestions , ( _ ) => {
158+ expect ( _ . ui5Node . kind ) . to . equal ( "UI5Class" ) ;
159+ const superClasses = getSuperClasses ( _ . ui5Node as UI5Class ) ;
160+ // Chai's `.include` is super slow, we must implement it ourselves...
161+ const doesSuggestionExtendsControl =
162+ find ( superClasses , baseControl ) !== undefined ;
163+ expect (
164+ doesSuggestionExtendsControl || _ . ui5Node === baseControl
165+ ) . to . be . true ;
166+ } ) ;
167+ } ,
168+ } ) ;
169+ } ) ;
170+ } ) ;
171+ } ) ;
172+
107173 context ( "classes under (implicit) default aggregations" , ( ) => {
108174 context ( "no prefix" , ( ) => {
109175 it ( "will suggest **all** classes matching the type of the default aggregation" , ( ) => {
0 commit comments