refactoring: remove some tests that don't work anymore

This commit is contained in:
Pieter Vander Vennet 2023-04-13 22:36:07 +02:00
parent ea62b5b7ff
commit a3242a3c7d
7 changed files with 247 additions and 235 deletions

View file

@ -57,29 +57,6 @@ export class TextField extends InputElement<string> {
return this._isValid(t)
}
/**
*
* // should update placeholders dynamically
* const placeholder = new UIEventSource<string>("placeholder")
* const tf = new TextField({
* placeholder
* })
* const html = <HTMLInputElement> tf.InnerConstructElement().children[0];
* html.placeholder // => 'placeholder'
* placeholder.setData("another piece of text")
* html.placeholder// => "another piece of text"
*
* // should update translated placeholders dynamically
* const placeholder = new Translation({nl: "Nederlands", en: "English"})
* Locale.language.setData("nl");
* const tf = new TextField({
* placeholder
* })
* const html = <HTMLInputElement> tf.InnerConstructElement().children[0];
* html.placeholder// => "Nederlands"
* Locale.language.setData("en");
* html.placeholder // => 'English'
*/
protected InnerConstructElement(): HTMLElement {
const options = this._options
const self = this

View file

@ -33,14 +33,6 @@ export default class OpeningHoursPicker extends InputElement<OpeningHour[]> {
return true
}
/**
*
* const rules = OH.ParseRule("Jul-Aug Sa closed; Mo,Tu,Th,Fr,PH 12:00-22:30, We 17:00-22:30, Sa 14:00-19:00, Su 10:00-21:00; Dec 24,25,31 off; Jan 1 off")
* const v = new UIEventSource(rules)
* const ohpicker = new OpeningHoursPicker(v)
* const html = ohpicker.InnerConstructElement()
* html !== undefined // => true
*/
protected InnerConstructElement(): HTMLElement {
return this._backgroundTable.ConstructElement()
}

View file

@ -25,20 +25,6 @@ export default class PublicHolidayInput extends InputElement<string> {
return true
}
/**
*
* // should construct an element
* const html = new PublicHolidayInput().InnerConstructElement()
* html !== undefined // => true
*
* // should construct an element despite having an invalid input
* const html = new PublicHolidayInput(new UIEventSource("invalid")).InnerConstructElement()
* html !== undefined // => true
*
* // should construct an element despite having null as input
* const html = new PublicHolidayInput(new UIEventSource(null)).InnerConstructElement()
* html !== undefined // => true
*/
protected InnerConstructElement(): HTMLElement {
const dropdown = new DropDown(Translations.t.general.opening_hours.open_during_ph.Clone(), [
{ shown: Translations.t.general.opening_hours.ph_not_known.Clone(), value: "" },

View file

@ -118,23 +118,6 @@ export class Translation extends BaseUIElement {
return ""
}
/**
*
* // Should actually change the content based on the current language
* const tr = new Translation({"en":"English", nl: "Nederlands"})
* Locale.language.setData("en")
* const html = tr.InnerConstructElement()
* html.innerHTML // => "English"
* Locale.language.setData("nl")
* html.innerHTML // => "Nederlands"
*
* // Should include a link to weblate if context is set
* const tr = new Translation({"en":"English"}, "core:test.xyz")
* Locale.language.setData("nl")
* Locale.showLinkToWeblate.setData(true)
* const html = tr.InnerConstructElement()
* html.getElementsByTagName("a")[0].href // => "https://hosted.weblate.org/translate/mapcomplete/core/nl/?offset=1&q=context%3A%3D%22test.xyz%22"
*/
InnerConstructElement(): HTMLElement {
const el = document.createElement("span")
const self = this