<commit_before>import {
  moduleFor,
  test
} from 'ember-qunit';

moduleFor('service:icon', {
  // Specify the other units that are required for this test.
  // needs: ['service:foo']
});

// Replace this with your real tests.
test('it exists', function(assert) {
  var service = this.subject();
  assert.ok(service);
});

test('should get a single svg icon', function(assert) {
	assert.expect(0);
});<commit_msg>Add basic unit test for icon service<commit_after>import {
	moduleFor,
	test
}
from 'ember-qunit';

import Ember from 'ember';

moduleFor('service:icon', {
	// Specify the other units that are required for this test.
	// needs: ['service:foo']
});

function updateDefaults(svg) {
	svg = Ember.$(svg);

	console.log('before: ', svg[0].outerHTML);

	svg[0].setAttribute('xmlns', 'http://www.w3.org/2000/svg');

	svg[0].setAttribute('fit', '');
	svg[0].setAttribute('height', '100%');
	svg[0].setAttribute('width', '100%');
	svg[0].setAttribute('preserveAspectRatio', 'xMidYMid meet');


	svg[0].setAttribute('viewBox', ('0 0 24 24'));

	svg.css({
		'pointer-events': 'none',
		'display': 'block'
	});


	console.log('after: ', svg[0].outerHTML);

	return svg[0].outerHTML;
}

// Replace this with your real tests.
test('it exists', function(assert) {
	var service = this.subject();
	assert.ok(service);
});

test('should get a single svg icon', function(assert) {

	var icon,
		expected = updateDefaults('<svg version="1.1" x="0px" y="0px" viewBox="0 0 24 24"><g><path d="M12 2c-5.53 0-10 4.47-10 10s4.47 10 10 10 10-4.47 10-10-4.47-10-10-10zm5 13.59l-1.41 1.41-3.59-3.59-3.59 3.59-1.41-1.41 3.59-3.59-3.59-3.59 1.41-1.41 3.59 3.59 3.59-3.59 1.41 1.41-3.59 3.59 3.59 3.59z"/></g></svg>'),
		service = this.subject();

	Ember.run(() => {
		service.getIcon('cancel').then((result) => {
			icon = result;
		});
	});

	console.log('expected:', expected);
	console.log('actual:', icon[0].outerHTML);

	assert.equal(icon[0].outerHTML, expected);
});
{'fraction_non_alphanumeric': 0.20869565217391303, 'fraction_numerical': 0.08132992327365729, 'mean_word_length': 4.12041884816754, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 1}, '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': '5695165', 'n_tokens_mistral': 845, 'n_tokens_neox': 740, 'n_words': 163}