Sha256: eb4a56467db89f9008d7bfff0bf73ff8688aee898441970ad747b5bced17a387

Contents?: true

Size: 1.95 KB

Versions: 46

Compression:

Stored size: 1.95 KB

Contents

/* eslint-disable sort-keys */

import {
    expect
} from 'chai';
import {
    drawBorder,
    drawBorderTop,
    drawBorderJoin,
    drawBorderBottom
} from './../src/drawBorder';

describe('drawBorder', () => {
  it('draws a border using parts', () => {
    const parts = {
      left: '╔',
      right: '╗',
      body: '═',
      join: '╤'
    };

    expect(drawBorder([1], parts)).to.equal('╔═╗\n');
    expect(drawBorder([1, 1], parts)).to.equal('╔═╤═╗\n');
    expect(drawBorder([5, 10], parts)).to.equal('╔═════╤══════════╗\n');
  });
});

describe('drawBorderTop', () => {
  it('draws a border using parts', () => {
    const parts = {
      topLeft: '╔',
      topRight: '╗',
      topBody: '═',
      topJoin: '╤'
    };

    expect(drawBorderTop([1], parts)).to.equal('╔═╗\n');
    expect(drawBorderTop([1, 1], parts)).to.equal('╔═╤═╗\n');
    expect(drawBorderTop([5, 10], parts)).to.equal('╔═════╤══════════╗\n');
  });
});

describe('drawBorderJoin', () => {
  it('draws a border using parts', () => {
    const parts = {
      joinBody: '─',
      joinLeft: '╟',
      joinRight: '╢',
      joinJoin: '┼'
    };

    expect(drawBorderJoin([1], parts)).to.equal('╟─╢\n');
    expect(drawBorderJoin([1, 1], parts)).to.equal('╟─┼─╢\n');
    expect(drawBorderJoin([5, 10], parts)).to.equal('╟─────┼──────────╢\n');
  });
});

describe('drawBorderBottom', () => {
  it('draws a border using parts', () => {
    const parts = {
      bottomBody: '═',
      bottomJoin: '╧',
      bottomLeft: '╚',
      bottomRight: '╝'
    };

    expect(drawBorderBottom([1], parts)).to.equal('╚═╝\n');
    expect(drawBorderBottom([1, 1], parts)).to.equal('╚═╧═╝\n');
    expect(drawBorderBottom([5, 10], parts)).to.equal('╚═════╧══════════╝\n');
  });
});

Version data entries

46 entries across 46 versions & 3 rubygems

Version Path
govuk_publishing_components-18.0.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.21.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.20.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.19.1 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.19.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.18.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.17.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.16.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.15.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.14.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.13.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.12.2 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.12.1 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.12.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.11.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.10.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.9.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.8.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.7.0 node_modules/table/test/drawBorder.js
govuk_publishing_components-17.6.1 node_modules/table/test/drawBorder.js