<commit_before><!doctype html>
<!--
  ~ Copyright 2017 <NAME>, S.A.
  ~
  ~ 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.
  -->

<html>

<head>
  <title>build-tile web component testing page</title>

  <script src="/node_modules/karma-read-json/karma-read-json.js"></script>
  <script src="/test/bootstrap.js"></script>
</head>

<body>

  <script>
    describe('<buildsstats-tile>', () => {

      let component;

      var server;

      function appendComponent() {
        component = document.createElement('buildsstats-tile');
        document.body.appendChild(component);
        component.setAttribute('pconfig', '{}');
        component.setAttribute('enabled', 'true');
        component.setAttribute('pid', dashboardForTesting);
      }

      beforeEach(() => {
        server = buildFakeServer();
      });

      afterEach(() => {
        server.restore();
        component.setAttribute('enabled', 'false');
      });

      describe('events', () => {

        var testHandler;
        var handler = function (e) {
          if (testHandler) {
            testHandler(e);
          }
        };

        beforeEach(() => {
          document.addEventListener('dashboard-updated', handler);
        });

        afterEach(() => {
          document.removeEventListener('dashboard-updated', handler);
          testHandler = undefined;
        });

        it('should raise an event when it succeds', (done) => {
          appendComponent();
          testHandler = function (e) {
            expect(e.detail.status).toBe('unknown');
            done();
          }
          server.respond();<commit_msg>fix(tests): fix flaky failing test due to data<commit_after><!doctype html>
<!--
  ~ Copyright 2017 <NAME>, S.A.
  ~
  ~ 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.
  -->

<html>

<head>
  <title>build-tile web component testing page</title>

  <script src="/node_modules/karma-read-json/karma-read-json.js"></script>
  <script src="/test/bootstrap.js"></script>
</head>

<body>

  <script>
    describe('<buildsstats-tile>', () => {

      let component;

      var server;

      function appendComponent() {
        component = document.createElement('buildsstats-tile');
        document.body.appendChild(component);
        component.setAttribute('pconfig', '{}');
        component.setAttribute('enabled', 'true');
        component.setAttribute('pid', dashboardForTesting);
      }

      beforeEach(() => {
        server = buildFakeServer();
      });

      afterEach(() => {
        server.restore();
        component.setAttribute('enabled', 'false');
      });

      describe('events', () => {

        var testHandler;
        var handler = function (e) {
          if (testHandler) {
            testHandler(e);
          }
        };

        beforeEach(() => {
          document.addEventListener('dashboard-updated', handler);
        });

        afterEach(() => {
          document.removeEventListener('dashboard-updated', handler);
          testHandler = undefined;
        });

        it('should raise an event when it succeds', (done) => {
          appendComponent();
          testHandler = function (e) {
            expect(e.detail.status).toBe('empty');
            done();
          }
          server.respond();
{'fraction_non_alphanumeric': 0.13341094295692665, 'fraction_numerical': 0.0037252619324796275, 'mean_word_length': 2.4423076923076925, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '137868', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1123, 'n_words': 312}