Parcourir la source

Merge pull request #553 from janl/escaped-lookup-test

Assert null lookup when rendering an unescaped value
tags/v2.3.0
David da Silva il y a 10 ans
Parent
révision
9017163785
5 fichiers modifiés avec 32 ajouts et 30 suppressions
  1. +1
    -0
      test/_files/escaped.js
  2. +1
    -1
      test/_files/escaped.mustache
  3. +27
    -27
      test/_files/null_lookup_object.js
  4. +2
    -1
      test/_files/unescaped.js
  5. +1
    -1
      test/_files/unescaped.mustache

+ 1
- 0
test/_files/escaped.js Voir le fichier

@@ -2,5 +2,6 @@
title: function () { title: function () {
return "Bear > Shark"; return "Bear > Shark";
}, },
symbol: null,
entities: "&quot; \"'<>`=/" entities: "&quot; \"'<>`=/"
}) })

+ 1
- 1
test/_files/escaped.mustache Voir le fichier

@@ -1,2 +1,2 @@
<h1>{{title}}</h1>
<h1>{{title}}{{symbol}}</h1>
And even {{entities}}, but not {{{entities}}}. And even {{entities}}, but not {{{entities}}}.

+ 27
- 27
test/_files/null_lookup_object.js Voir le fichier

@@ -1,31 +1,31 @@
({ ({
"name": "David",
"twitter": "@dasilvacontin",
"fobject": [
{
"name": "Flor",
"twitter": "@florrts"
},
{
"name": "Miquel",
"twitter": null
},
{
"name": "Chris",
"twitter": undefined
}
],
"favorites": {
"color": "blue",
"president": "Bush",
"show": "Futurama"
"name": "David",
"twitter": "@dasilvacontin",
"fobject": [
{
"name": "Flor",
"twitter": "@florrts"
},
{
"name": "Miquel",
"twitter": null
}, },
"mascot": {
"name": "Squid",
"favorites": {
"color": "orange",
"president": undefined,
"show": null
}
{
"name": "Chris",
"twitter": undefined
}
],
"favorites": {
"color": "blue",
"president": "Bush",
"show": "Futurama"
},
"mascot": {
"name": "Squid",
"favorites": {
"color": "orange",
"president": undefined,
"show": null
} }
}
}) })

+ 2
- 1
test/_files/unescaped.js Voir le fichier

@@ -1,5 +1,6 @@
({ ({
title: function () { title: function () {
return "Bear > Shark"; return "Bear > Shark";
}
},
symbol: null
}) })

+ 1
- 1
test/_files/unescaped.mustache Voir le fichier

@@ -1 +1 @@
<h1>{{{title}}}</h1>
<h1>{{{title}}}{{{symbol}}}</h1>

Chargement…
Annuler
Enregistrer