// Copyright 2017 The Closure Library Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

goog.module('goog.dom.textassert_test');
goog.setTestOnly();

var testSuite = goog.require('goog.testing.testSuite');
var textAssert = goog.require('goog.dom.textAssert');
var userAgent = goog.require('goog.userAgent');

testSuite({
  shouldRunTests() {
    return !userAgent.IE || userAgent.isVersionOrHigher(9);
  },
  testAssertIsTextWillThrow: function() {
    assertThrows(() => textAssert.assertHtmlFree('<b>a<\b>'));
  },

  testAssertIsTextDoesNotChangeText: function() {
    var plain = 'text';
    assertEquals(plain, textAssert.assertHtmlFree(plain));
  },
});

@@ -683,19 +683,21 @@
 nly();%0A%0A
-var
+const
  testSui
@@ -741,19 +741,21 @@
 uite');%0A
-var
+const
  textAss
@@ -797,19 +797,21 @@
 sert');%0A
-var
+const
  userAge
@@ -946,16 +946,17 @@
 );%0A  %7D,%0A
+%0A
   testAs
@@ -969,17 +969,26 @@
 Text
-Will
 Throw
+sWithHtmlTags
 : fu
@@ -997,24 +997,34 @@
 tion() %7B%0A   
+ const e =
  assertThrow
@@ -1068,15 +1068,456 @@
 %3Ea%3C%5C
+%5C
 b%3E'));%0A
+    assertEquals(%0A        'Assertion failed: String has HTML original: ' +%0A            '%3Cb%3Ea%3C%5C%5Cb%3E, escaped: &lt;b&gt;a&lt;%5C%5Cb&gt;',%0A        e.message);%0A  %7D,%0A%0A  testAssertIsTextThrowsWithHtmlEntities: function() %7B%0A    const e = assertThrows(() =%3E %7B%0A      textAssert.assertHtmlFree('a&amp;b');%0A    %7D);%0A    assertEquals(%0A        'Assertion failed: String has HTML original: ' +%0A            'a&amp;b, escaped: a&amp;amp;b',%0A        e.message);%0A
   %7D,
@@ -1576,11 +1576,13 @@
     
-var
+const
  pla

Add a test for HTML entities for goog.dom.textassert, and verify the thrown values in those tests.