mseemann/angular2-mdl

View on GitHub
projects/core/src/lib/table/mdl-table.spec.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { MdlDefaultTableModel } from "./mdl-table.component";

describe("Component: MdlTableModel", () => {
  let tableModel: MdlDefaultTableModel | undefined;

  beforeEach(() => {
    tableModel = new MdlDefaultTableModel([
      { key: "key", name: "name", numeric: false },
    ]);
  });

  it("should be possible to access the columns", () => {
    expect(tableModel?.columns.length).toBe(1);
  });

  it("should be possible to add tabel data", () => {
    tableModel?.addAll([{ selected: true }]);

    expect(tableModel?.data.length).toBe(1);
  });
});