Skip to content

Commit

Permalink
used string templates for test descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
BigFunger committed Sep 22, 2016
1 parent ee6962c commit 6797ca5
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let init;
let $rootScope;
let $compile;

describe('draggable_* directives', function () {
describe(`draggable_* directives`, function () {

beforeEach(ngMock.module('kibana'));
beforeEach(ngMock.inject(function ($injector) {
Expand Down Expand Up @@ -35,36 +35,36 @@ describe('draggable_* directives', function () {
};
}));

describe('draggable_container directive', function () {
it('should expose the drake', function () {
describe(`draggable_container directive`, function () {
it(`should expose the drake`, function () {
const { $scope } = init();
expect($scope.drake).to.be.an(Object);
});

it('should expose the controller', function () {
it(`should expose the controller`, function () {
const { $scope } = init();
expect($scope.draggableContainerCtrl).to.be.an(Object);
});

it('should pull item list from directive attribute', function () {
it(`should pull item list from directive attribute`, function () {
const { $scope, $parentScope } = init();
expect($scope.draggableContainerCtrl.getList()).to.eql($parentScope.items);
});

it('should not be able to move extraneous DOM elements', function () {
it(`should not be able to move extraneous DOM elements`, function () {
const bare = angular.element(`<div>`);
const { $scope } = init();
expect($scope.drake.canMove(bare[0])).to.eql(false);
});

it('should not be able to move non-[draggable-item] elements', function () {
it(`should not be able to move non-[draggable-item] elements`, function () {
const bare = angular.element(`<div>`);
const { $scope, $elem } = init();
$elem.append(bare);
expect($scope.drake.canMove(bare[0])).to.eql(false);
});

it('shouldn\'t be able to move extraneous [draggable-item] elements', function () {
it(`shouldn't be able to move extraneous [draggable-item] elements`, function () {
const anotherParent = angular.element(`<div draggable-container="items">`);
const item = angular.element(`<div draggable-item="items[0]">`);
const scope = $rootScope.$new();
Expand All @@ -76,7 +76,7 @@ describe('draggable_* directives', function () {
expect($scope.drake.canMove(item[0])).to.eql(false);
});

it('shouldn\'t be able to move [draggable-item] if it has a handle', function () {
it(`shouldn't be able to move [draggable-item] if it has a handle`, function () {
const { $scope, $elem } = init(`
<div draggable-item="items[0]">
<div draggable-handle></div>
Expand All @@ -86,7 +86,7 @@ describe('draggable_* directives', function () {
expect($scope.drake.canMove(item[0])).to.eql(false);
});

it('should be able to move [draggable-item] by its handle', function () {
it(`should be able to move [draggable-item] by its handle`, function () {
const { $scope, $elem } = init(`
<div draggable-item="items[0]">
<div draggable-handle></div>
Expand All @@ -97,8 +97,8 @@ describe('draggable_* directives', function () {
});
});

describe('draggable_item', function () {
it('should be required to be a child to [draggable-container]', function () {
describe(`draggable_item`, function () {
it(`should be required to be a child to [draggable-container]`, function () {
const item = angular.element(`<div draggable-item="items[0]">`);
const scope = $rootScope.$new();
expect(() => {
Expand All @@ -108,7 +108,7 @@ describe('draggable_* directives', function () {
});
});

describe('draggable_handle', function () {
describe(`draggable_handle`, function () {
it('should be required to be a child to [draggable-item]', function () {
const handle = angular.element(`<div draggable-handle>`);
const scope = $rootScope.$new();
Expand Down

0 comments on commit 6797ca5

Please sign in to comment.