<commit_before>
"use strict";

import {default as Monad} from '../../angular';

describe('directive: mo-field', () => {
    let element;
    let scope;
    let compile;
    let item = {test: 'foo'};
    let tpl = angular.element(`<mo-field label="test"><input type="text" ng-model="item"></mo-field>`);

    beforeEach(angular.mock.module('TEMPLATES'));
    beforeEach(angular.mock.module(Monad));
    beforeEach(inject(($rootScope, $compile) => {
        scope = $rootScope;
        compile = $compile;
    }));

    it('should insert the field into a form group', () => {
        scope.$apply(() => {
            scope.item = item;
        });
        element = compile(tpl)(scope);
        scope.$digest();
        expect(element.find('div').eq(0).hasClass('form-group')).toBe(true);
        expect(element.find('label').text().replace(/\s+/, '')).toEqual('test');
        expect(element.find('input').hasClass('form-control')).toBe(true);
    });
});

<commit_msg>this is an expression, not a string<commit_after>
"use strict";

import {default as Monad} from '../../angular';

describe('directive: mo-field', () => {
    let element;
    let scope;
    let compile;
    let item = {test: 'foo'};
    let tpl = angular.element(`<mo-field label="'test'"><input type="text" ng-model="item"></mo-field>`);

    beforeEach(angular.mock.module('TEMPLATES'));
    beforeEach(angular.mock.module(Monad));
    beforeEach(inject(($rootScope, $compile) => {
        scope = $rootScope;
        compile = $compile;
    }));

    it('should insert the field into a form group', () => {
        scope.$apply(() => {
            scope.item = item;
        });
        element = compile(tpl)(scope);
        scope.$digest();
        expect(element.find('div').eq(0).hasClass('form-group')).toBe(true);
        expect(element.find('label').text().replace(/\s+/, '')).toEqual('test');
        expect(element.find('input').hasClass('form-control')).toBe(true);
    });
});


{'fraction_non_alphanumeric': 0.2086734693877551, 'fraction_numerical': 0.0010204081632653062, 'mean_word_length': 3.0102249488752557, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, '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': '5493356', 'n_tokens_mistral': 604, 'n_tokens_neox': 603, 'n_words': 112}