@@ -350,6 +350,105 @@ describe('vscode-multi-select', () => {
350350 expect ( el . value ) . to . eql ( [ 'asdf' ] ) ;
351351 } ) ;
352352
353+ describe ( 'i18n override props' , ( ) => {
354+ it ( 'selected-text overrides the badge label' , async ( ) => {
355+ const el = await fixture < VscodeMultiSelect > ( html `
356+ < vscode-multi-select selected-text ="Ausgewählt ">
357+ < vscode-option selected > One</ vscode-option >
358+ < vscode-option > Two</ vscode-option >
359+ </ vscode-multi-select >
360+ ` ) ;
361+ expect ( el . shadowRoot ?. querySelector ( '.select-face-badge' ) ) . lightDom . to . eq (
362+ '1 Ausgewählt'
363+ ) ;
364+ } ) ;
365+
366+ it ( 'selected-text overrides the badge label when nothing is selected' , async ( ) => {
367+ const el = await fixture < VscodeMultiSelect > ( html `
368+ < vscode-multi-select selected-text ="Ausgewählt ">
369+ < vscode-option > One</ vscode-option >
370+ < vscode-option > Two</ vscode-option >
371+ </ vscode-multi-select >
372+ ` ) ;
373+ expect ( el . shadowRoot ?. querySelector ( '.select-face-badge' ) ) . lightDom . to . eq (
374+ '0 Ausgewählt'
375+ ) ;
376+ } ) ;
377+
378+ it ( 'open-button-aria-label overrides the combobox button aria-label' , async ( ) => {
379+ const el = await fixture < VscodeMultiSelect > ( html `
380+ < vscode-multi-select combobox open-button-aria-label ="Öffnen ">
381+ < vscode-option > One</ vscode-option >
382+ </ vscode-multi-select >
383+ ` ) ;
384+ const btn =
385+ el . shadowRoot ?. querySelector < HTMLButtonElement > ( '.combobox-button' ) ;
386+ expect ( btn ?. getAttribute ( 'aria-label' ) ) . to . eq ( 'Öffnen' ) ;
387+ } ) ;
388+
389+ it ( 'no-options-text is shown when the filter matches nothing' , async ( ) => {
390+ const el = await fixture < VscodeMultiSelect > ( html `
391+ < vscode-multi-select combobox no-options-text ="Keine Optionen ">
392+ < vscode-option > Lorem</ vscode-option >
393+ </ vscode-multi-select >
394+ ` ) ;
395+ el . focus ( ) ;
396+ await el . updateComplete ;
397+ await sendKeys ( { type : 'zzz' } ) ;
398+ await el . updateComplete ;
399+ const noOpts = el . shadowRoot ?. querySelector ( '.no-options' ) ;
400+ expect ( noOpts ?. textContent ?. trim ( ) ) . to . eq ( 'Keine Optionen' ) ;
401+ } ) ;
402+
403+ it ( 'create-option-prefix overrides the creatable suggestion text' , async ( ) => {
404+ const el = await fixture < VscodeMultiSelect > ( html `
405+ < vscode-multi-select
406+ combobox
407+ creatable
408+ create-option-prefix ="Hinzufügen "
409+ >
410+ < vscode-option > Lorem</ vscode-option >
411+ </ vscode-multi-select >
412+ ` ) ;
413+ el . focus ( ) ;
414+ await el . updateComplete ;
415+ await sendKeys ( { type : 'Neu' } ) ;
416+ await el . updateComplete ;
417+ const placeholder = el . shadowRoot ?. querySelector ( '.option.placeholder' ) ;
418+ expect ( placeholder ?. textContent ?. trim ( ) ) . to . eq ( 'Hinzufügen "Neu"' ) ;
419+ } ) ;
420+
421+ it ( 'select-all-title overrides the select-all button tooltip' , async ( ) => {
422+ const el = await fixture < VscodeMultiSelect > ( html `
423+ < vscode-multi-select select-all-title ="Alle auswählen ">
424+ < vscode-option > One</ vscode-option >
425+ < vscode-option > Two</ vscode-option >
426+ </ vscode-multi-select >
427+ ` ) ;
428+ expect ( el . selectAllTitle ) . to . eq ( 'Alle auswählen' ) ;
429+ } ) ;
430+
431+ it ( 'deselect-all-title overrides the deselect-all button tooltip' , async ( ) => {
432+ const el = await fixture < VscodeMultiSelect > ( html `
433+ < vscode-multi-select deselect-all-title ="Alle abwählen ">
434+ < vscode-option > One</ vscode-option >
435+ < vscode-option > Two</ vscode-option >
436+ </ vscode-multi-select >
437+ ` ) ;
438+ expect ( el . deselectAllTitle ) . to . eq ( 'Alle abwählen' ) ;
439+ } ) ;
440+
441+ it ( 'accept-button-text overrides the OK button label' , async ( ) => {
442+ const el = await fixture < VscodeMultiSelect > ( html `
443+ < vscode-multi-select accept-button-text ="Bestätigen ">
444+ < vscode-option > One</ vscode-option >
445+ < vscode-option > Two</ vscode-option >
446+ </ vscode-multi-select >
447+ ` ) ;
448+ expect ( el . acceptButtonText ) . to . eq ( 'Bestätigen' ) ;
449+ } ) ;
450+ } ) ;
451+
353452 it ( 'selects multiple options with keyboard' ) ;
354453 it ( 'selectedIndexes sync with values' ) ;
355454 it (
0 commit comments