forked from MapComplete/MapComplete
Fix tests
This commit is contained in:
parent
d875dffe1c
commit
006941d21b
2 changed files with 7 additions and 5 deletions
|
@ -90,9 +90,7 @@ export default class UrlValidator extends Validator {
|
||||||
*
|
*
|
||||||
* const v = new UrlValidator()
|
* const v = new UrlValidator()
|
||||||
* v.getFeedback("example.").textFor("en") // => "This is not a valid web address"
|
* v.getFeedback("example.").textFor("en") // => "This is not a valid web address"
|
||||||
* v.isValid("https://booking.com/some-hotel.html") // => false
|
* v.getFeedback("https://booking.com/some-hotel.html").textFor("en") // => Translations.t.validation.url.spamSite.Subs({host: "booking.com"}).textFor("en")
|
||||||
* v.getFeedback("https://booking.com/some-hotel.html").textFor("en").indexOf("low-quality") > 0 // => true
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
getFeedback(s: string, getCountry?: () => string): Translation | undefined {
|
getFeedback(s: string, getCountry?: () => string): Translation | undefined {
|
||||||
if (
|
if (
|
||||||
|
@ -128,6 +126,10 @@ export default class UrlValidator extends Validator {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* const v = new UrlValidator()
|
||||||
|
* v.isValid("https://booking.com/some-hotel.html") // => false
|
||||||
|
*/
|
||||||
isValid(str: string): boolean {
|
isValid(str: string): boolean {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -2815,10 +2815,10 @@ describe("SplitAction", () => {
|
||||||
|
|
||||||
expect(changes[1].changes["nodes"]).toEqual([
|
expect(changes[1].changes["nodes"]).toEqual([
|
||||||
6490126559, 8715440375, 8715440374, 8715440373, 8715440372, 8715440371, 8715440370,
|
6490126559, 8715440375, 8715440374, 8715440373, 8715440372, 8715440371, 8715440370,
|
||||||
8715440369, -1,
|
8715440369, -2,
|
||||||
])
|
])
|
||||||
expect(changes[2].changes["nodes"]).toEqual([
|
expect(changes[2].changes["nodes"]).toEqual([
|
||||||
-1, 8715440368, 8715440367, 8715440366, 8715440365, 8715440364, 8715440363,
|
-2, 8715440368, 8715440367, 8715440366, 8715440365, 8715440364, 8715440363,
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue