<commit_before>import { default as Backdraft } from "../src/entry";

describe("DataTable Plugin", function() {
  let app;
  let baseExports;
  let collection;
  let table;

  function getHeaders(table) {
    return table.$("thead tr th").map(function() {
      return $(this).text();
    }).get();
  }

  beforeEach(function() {
    Backdraft.app.destroyAll();
    app = Backdraft.app("myapp", {
      plugins: ["DataTable"]
    });
    app.model("M", {});
    app.collection("Col", {
      model: app.Models.M
    });
    collection = new app.Collections.Col();
    baseExports = Backdraft.plugin("Base");
  });

  describe("factories and constructors", function() {
    it("should expose #dataTable and #dataTable.row", function() {
      app.view.dataTable.row("Abc", { columns: [] });
      app.view.dataTable("Def", {
        rowClassName: "Abc"
      });
      expect(new app.Views.Abc({ columnsConfig: [] })).toEqual(jasmine.any(baseExports.View));
      expect(new app.Views.Def({ collection })).toEqual(jasmine.any(baseExports.View));
    });

    it("should allow rows to be subclassed", function() {
      app.view.dataTable.row("Abc", {
        baseMethod() {
          return "i am base";
        }
      });

      app.view.dataTable.row("new_abc", "Abc", {
        baseMethod() {
          return "i am the new base";
        }
      });
<commit_msg>TECH-2322 expose es6 modules: remove use of Base plugin in specs<commit_after>import { default as Backdraft } from "../src/entry";
import View from "../src/view";

describe("DataTable Plugin", function() {
  let app;
  let collection;
  let table;

  function getHeaders(table) {
    return table.$("thead tr th").map(function() {
      return $(this).text();
    }).get();
  }

  beforeEach(function() {
    Backdraft.app.destroyAll();
    app = Backdraft.app("myapp", {
      plugins: ["DataTable"]
    });
    app.model("M", {});
    app.collection("Col", {
      model: app.Models.M
    });
    collection = new app.Collections.Col();
  });

  describe("factories and constructors", function() {
    it("should expose #dataTable and #dataTable.row", function() {
      app.view.dataTable.row("Abc", { columns: [] });
      app.view.dataTable("Def", {
        rowClassName: "Abc"
      });
      expect(new app.Views.Abc({ columnsConfig: [] })).toEqual(jasmine.any(View));
      expect(new app.Views.Def({ collection })).toEqual(jasmine.any(View));
    });

    it("should allow rows to be subclassed", function() {
      app.view.dataTable.row("Abc", {
        baseMethod() {
          return "i am base";
        }
      });

      app.view.dataTable.row("new_abc", "Abc", {
        baseMethod() {
          return "i am the new base";
        }
      });

{'fraction_non_alphanumeric': 0.17571533382245047, 'fraction_numerical': 0.001834189288334556, 'mean_word_length': 2.675202156334232, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1185264', 'n_tokens_mistral': 869, 'n_tokens_neox': 847, 'n_words': 182}