<commit_before><!DOCTYPE html>
<html>
<head>
  <title>UQ Library Proactive Chat</title>
  <meta name=viewport content="width=device-width, initial-scale=1">
  <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
  <script src="../node_modules/web-component-tester/browser.js"></script>
  <script src="../bower_components/test-fixture/test-fixture-mocha.js"></script>
  <link rel="import" href="../bower_components/test-fixture/test-fixture.html">

  <link rel="import" href="../elements/uql-chat-proactive/uql-chat-proactive.html">
  <style>
    body {
      margin: 0;
      padding: 0;
    }
  </style>
</head>
<body class="fullbleed layout vertical">
<test-fixture id="basic">
  <template>
    <uql-chat-proactive></uql-chat-proactive>
  </template>
</test-fixture>
<script>
  suite('<uql-chat-proactive> tests', function () {
    var testObj;

    setup(function () {
      testObj = fixture('basic');
      document.cookie="UQLMockData=enabled";
    });

//    a11ySuite('basic');

    suite('domain test method unit tests', function () {

      test('if search.library recognised', function (done) {
        var input = 'search.library.uq.edu.au';
        var output = '.library.uq.edu.au';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

      test('if www.library recognised', function (done) {
        var input = 'www.library.uq.edu.au';
        var output = '.library.uq.edu.au';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

      test('if web.library recognised', function (done) {
        var input = 'web.library.uq.edu.au';
        var output = '.library.uq.edu.au';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

      test('if studenthub recognised', function (done) {
        var input = 'www.studenthub.uq.edu.au';
        var output = '.studenthub.uq.edu.au';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

      test('if omeka recognised', function (done) {
        var input = 'uqlibraryonlineexhibitions.omeka.net';
        var output = '.uqlibraryonlineexhibitions.omeka.net';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

      test('if www - free domain recognised', function (done) {
        var input = 'studenthub.uq.edu.au';
        var output = '.studenthub.uq.edu.au';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

    });

    suite('set data unit tests', function () {
      test('if chat url is correctly set', function (done) {

        var input = {
            "items": [
              {
                "label": "FAQ"
              },
              {
                "label": "Chat",
                "icon": "communication:chat",
                "link": "https://uqcurrent.custhelp.com/app/chat/chat_launch_lib/p/45",
                "disabled": "chat-offline",
                "target": "chatWindow",
                "targetOptions": "width=474, height=600"
              },
              {
                "label": "Email"
              },
              {
                "label": "Phone"
              },
              {
                "label": "Contact form"
              },
              {
                "label": "Come see us"
              }
            ],
            "summary": {
              "label": "More ways to contact us"
            }
          };
        var output = 'Chat';
        expect(output).to.equal(testObj._setLink(input, 'Chat').label);
        done();
      });

      test('if contact url is correctly set', function (done) {

          var input = {
              "items": [
                {
                  "label": "FAQ"
                },
                {
                  "label": "Chat"
                },
                {
                  "label": "Email"
                },
                {
                  "label": "Phone"
                },
                {
                  "label": "Contact form",
                  "icon": "device:dvr",
                  "link": "https://uqcurrent.custhelp.com/app/library/contact"
                },
                {
                  "label": "Come see us"
                }
              ],
              "summary": {
                "label": "More ways to contact us"
              }
            };
          var output = 'Contact form';
          expect(output).to.equal(testObj._setLink(input, 'Contact form').label);
          done();
        });
      });

  });
</script>
</body>
</html><commit_msg>update test [PT #146423857]<commit_after><!DOCTYPE html>
<html>
<head>
  <title>UQ Library Proactive Chat</title>
  <meta name=viewport content="width=device-width, initial-scale=1">
  <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
  <script src="../node_modules/web-component-tester/browser.js"></script>
  <script src="../bower_components/test-fixture/test-fixture-mocha.js"></script>
  <link rel="import" href="../bower_components/test-fixture/test-fixture.html">

  <link rel="import" href="../elements/uql-chat-proactive/uql-chat-proactive.html">
  <style>
    body {
      margin: 0;
      padding: 0;
    }
  </style>
</head>
<body class="fullbleed layout vertical">
<test-fixture id="basic">
  <template>
    <uql-chat-proactive></uql-chat-proactive>
  </template>
</test-fixture>
<script>
  suite('<uql-chat-proactive> tests', function () {
    var testObj;

    setup(function () {
      testObj = fixture('basic');
      document.cookie="UQLMockData=enabled";
    });

//    a11ySuite('basic');

    suite('domain test method unit tests', function () {

      test('if search.library recognised', function (done) {
        var input = 'search.library.uq.edu.au';
        var output = '.library.uq.edu.au';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

      test('if www.library recognised', function (done) {
        var input = 'www.library.uq.edu.au';
        var output = '.library.uq.edu.au';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

      test('if web.library recognised', function (done) {
        var input = 'web.library.uq.edu.au';
        var output = '.library.uq.edu.au';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

      test('if studenthub recognised', function (done) {
        var input = 'www.studenthub.uq.edu.au';
        var output = '.studenthub.uq.edu.au';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

      test('if omeka recognised', function (done) {
        var input = 'uqlibraryonlineexhibitions.omeka.net';
        var output = '.uqlibraryonlineexhibitions.omeka.net';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

      test('if www - free domain recognised', function (done) {
        var input = 'studenthub.uq.edu.au';
        var output = '.studenthub.uq.edu.au';
        expect(output).to.equal(testObj.getDomain(input));
        done();
      });

    });

    suite('set data unit tests', function () {
      test('if chat url is correctly set', function (done) {

        var input = {
            "items": [
              {
                "label": "FAQ"
              },
              {
                "label": "Chat",
                "icon": "communication:chat",
                "link": "https://uqcurrent.custhelp.com/app/chat/chat_launch_lib/p/45",
                "disabled": "chat-offline",
                "target": "chatWindow",
                "targetOptions": "width=474, height=600"
              },
              {
                "label": "Email"
              },
              {
                "label": "Phone"
              },
              {
                "label": "Contact form"
              },
              {
                "label": "Come see us"
              }
            ],
            "summary": {
              "label": "More ways to contact us"
            }
          };
        var expected = 'communication:chat';
        expect(expected).to.equal(testObj._setLink(input, 'Chat').icon);
        done();
      });

      test('if contact url is correctly set', function (done) {

          var input = {
              "items": [
                {
                  "label": "FAQ"
                },
                {
                  "label": "Chat"
                },
                {
                  "label": "Email"
                },
                {
                  "label": "Phone"
                },
                {
                  "label": "Contact form",
                  "icon": "device:dvr",
                  "link": "https://uqcurrent.custhelp.com/app/library/contact"
                },
                {
                  "label": "Come see us"
                }
              ],
              "summary": {
                "label": "More ways to contact us"
              }
            };
          var expected = 'device:dvr';
          expect(expected).to.equal(testObj._setLink(input, 'Contact form').icon);
          done();
        });
      });

  });
</script>
</body>
</html>
{'fraction_non_alphanumeric': 0.15606748864373785, 'fraction_numerical': 0.0037854207224745835, 'mean_word_length': 1.5764837001950405, 'pattern_counts': {'":': 50, '<': 61, '<?xml version=': 0, '>': 61, 'https://': 4, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3848063', 'n_tokens_mistral': 2768, 'n_tokens_neox': 2639, 'n_words': 485}