<commit_before>var LayerModelBase = require('../../../../src/geo/map/layer-model-base');

var MyLayer = LayerModelBase.extend({});

fdescribe('geo/map/layer-model-base.js', function () {
  beforeEach(function () {
    this.layer = new MyLayer();
  });

  describe('.remove', function () {
    it('should trigger a destroy event', function () {
      var callback = jasmine.createSpy('callback');
      this.layer.bind('destroy', callback);

      this.layer.remove();

      expect(callback).toHaveBeenCalled();
    });
  });

  describe('.update', function () {
    it('should set the attributes', function () {
      this.layer.update({
        a: 1,
        b: 2
      });

      expect(this.layer.get('a')).toEqual(1);
      expect(this.layer.get('b')).toEqual(2);
    });
  });

  describe('.show', function () {
    it('should set the visible attribute to true', function () {
      this.layer.set('visible', false);

      this.layer.show();

      expect(this.layer.get('visible')).toBeTruthy();
    });
  });

  describe('.hide', function () {
    it('should set the visible attribute to false', function () {
      this.layer.set('visible', true);

      this.layer.hide();

      expect(this.layer.get('visible')).toBeFalsy();
    });
  });

  describe('.toggle', function () {
    it('should toggel the visible attribute', function () {
      this.layer.set('visible', false);

      this.layer.toggle();

      expect(this.layer.get('visible')).toBeTruthy();

      this.layer.toggle();

      expect(this.layer.get('visible')).toBeFalsy();
    });
  });
});
<commit_msg>Added some basic tests for src/geo/map/layer-model-base<commit_after>var LayerModelBase = require('../../../../src/geo/map/layer-model-base');

var MyLayer = LayerModelBase.extend({});

describe('geo/map/layer-model-base.js', function () {
  beforeEach(function () {
    this.layer = new MyLayer();
  });

  describe('.remove', function () {
    it('should trigger a destroy event', function () {
      var callback = jasmine.createSpy('callback');
      this.layer.bind('destroy', callback);

      this.layer.remove();

      expect(callback).toHaveBeenCalled();
    });
  });

  describe('.update', function () {
    it('should set the attributes', function () {
      this.layer.update({
        a: 1,
        b: 2
      });

      expect(this.layer.get('a')).toEqual(1);
      expect(this.layer.get('b')).toEqual(2);
    });
  });

  describe('.show', function () {
    it('should set the visible attribute to true', function () {
      this.layer.set('visible', false);

      this.layer.show();

      expect(this.layer.get('visible')).toBeTruthy();
    });
  });

  describe('.hide', function () {
    it('should set the visible attribute to false', function () {
      this.layer.set('visible', true);

      this.layer.hide();

      expect(this.layer.get('visible')).toBeFalsy();
    });
  });

  describe('.toggle', function () {
    it('should toggel the visible attribute', function () {
      this.layer.set('visible', false);

      this.layer.toggle();

      expect(this.layer.get('visible')).toBeTruthy();

      this.layer.toggle();

      expect(this.layer.get('visible')).toBeFalsy();
    });
  });
});

{'fraction_non_alphanumeric': 0.1991274540355251, 'fraction_numerical': 0.0024929884699283265, 'mean_word_length': 2.8721351025331723, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7139177', 'n_tokens_mistral': 989, 'n_tokens_neox': 964, 'n_words': 171}