<commit_before>import '../playlist_edit_ctrl';
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common';
import helpers from 'test/specs/helpers';

describe('PlaylistEditCtrl', function() {
    var ctx = new helpers.ControllerTestContext();

    var dashboards = [
        {
            id: 2,
            title: 'dashboard: 2'
        },
        {
            id: 3,
            title: 'dashboard: 3'
        }
    ];

    var playlistSrv = {};
    var backendSrv = {
      search: (query) => {
        return ctx.$q.when(dashboards);
      }
    };

    beforeEach(angularMocks.module('grafana.core'));
    beforeEach(angularMocks.module('grafana.controllers'));
    beforeEach(angularMocks.module('grafana.services'));
    beforeEach(ctx.providePhase({
        playlistSrv: playlistSrv,
        backendSrv: backendSrv,
        $route: { current: { params: { } } },
    }));

    beforeEach(ctx.createControllerPhase('PlaylistEditCtrl'));

    beforeEach(() => {
        ctx.scope.$digest();
    });

    describe('searchresult returns 2 dashboards', function() {
        it('found dashboard should be 2', function() {
            expect(ctx.scope.foundPlaylistItems.length).to.be(2);
        });<commit_msg>style(playlist): renames variable<commit_after>import '../playlist_edit_ctrl';
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common';
import helpers from 'test/specs/helpers';

describe('PlaylistEditCtrl', function() {
    var ctx = new helpers.ControllerTestContext();

    var searchResult = [
        {
            id: 2,
            title: 'dashboard: 2'
        },
        {
            id: 3,
            title: 'dashboard: 3'
        }
    ];

    var playlistSrv = {};
    var backendSrv = {
      search: (query) => {
        return ctx.$q.when(searchResult);
      }
    };

    beforeEach(angularMocks.module('grafana.core'));
    beforeEach(angularMocks.module('grafana.controllers'));
    beforeEach(angularMocks.module('grafana.services'));
    beforeEach(ctx.providePhase({
        playlistSrv: playlistSrv,
        backendSrv: backendSrv,
        $route: { current: { params: { } } },
    }));

    beforeEach(ctx.createControllerPhase('PlaylistEditCtrl'));

    beforeEach(() => {
        ctx.scope.$digest();
    });

    describe('searchresult returns 2 dashboards', function() {
        it('found dashboard should be 2', function() {
            expect(ctx.scope.foundPlaylistItems.length).to.be(2);
        });
{'fraction_non_alphanumeric': 0.145083932853717, 'fraction_numerical': 0.005595523581135092, 'mean_word_length': 2.580829756795422, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5394915', 'n_tokens_mistral': 772, 'n_tokens_neox': 745, 'n_words': 136}