<commit_before>// Additional tests which may not be interesting to upstream TinyMCE project but which reassure me 
// for specific use cases of mine

module("redsweater.UndoManager", {
	setupModule: function() {
		QUnit.stop();

		tinymce.init({
			selector: "textarea",
			add_unload_trigger: false,
			skin: false,
			init_instance_callback: function(ed) {
				window.editor = ed;
				QUnit.start();
			}
		});
	}
});

test('Ignored keystrokes', function() {
	editor.undoManager.clear();
	editor.setContent('test');

	expect(4);

	ok(!editor.undoManager.typing);

	// Command-A i.e. Select All
	editor.dom.fire(editor.getBody(), 'keydown', {keyCode: 65, metaKey:true});

	ok(!editor.undoManager.hasUndo());
	ok(!editor.undoManager.hasRedo());
	ok(!editor.undoManager.typing);
});

test('Ignored Adds', function() {
	editor.undoManager.clear();
	editor.setContent('test');

	var count = 0;

	editor.on('AddUndo', function() {
		count++;
	});
	
	expect(4);

	editor.dom.fire(editor.getBody(), 'keydown', {keyCode: 65});
	ok(editor.undoManager.typing);

	editor.dom.fire(editor.getBody(), 'keyup', {keyCode: 13});
	ok(!editor.undoManager.typing);

	equal(count, 1);

	editor.undoManager.add();
	editor.undoManager.add();
<commit_msg>Have to specify false for all the other modifier keys here too.<commit_after>// Additional tests which may not be interesting to upstream TinyMCE project but which reassure me 
// for specific use cases of mine

module("redsweater.UndoManager", {
	setupModule: function() {
		QUnit.stop();

		tinymce.init({
			selector: "textarea",
			add_unload_trigger: false,
			skin: false,
			init_instance_callback: function(ed) {
				window.editor = ed;
				QUnit.start();
			}
		});
	}
});

test('Ignored keystrokes', function() {
	editor.undoManager.clear();
	editor.setContent('test');

	expect(4);

	ok(!editor.undoManager.typing);

	// Command-A i.e. Select All
	editor.dom.fire(editor.getBody(), 'keydown', {keyCode: 65, metaKey:true, shiftKey:false, altKey:false, ctrlKey:false});
	ok(!editor.undoManager.hasUndo());
	ok(!editor.undoManager.hasRedo());
	ok(!editor.undoManager.typing);
});

test('Ignored Adds', function() {
	editor.undoManager.clear();
	editor.setContent('test');

	var count = 0;

	editor.on('AddUndo', function() {
		count++;
	});
	
	expect(4);

	editor.dom.fire(editor.getBody(), 'keydown', {keyCode: 65});
	ok(editor.undoManager.typing);

	editor.dom.fire(editor.getBody(), 'keyup', {keyCode: 13});
	ok(!editor.undoManager.typing);

	equal(count, 1);

	editor.undoManager.add();
	editor.undoManager.add();

{'fraction_non_alphanumeric': 0.1724003127443315, 'fraction_numerical': 0.007818608287724784, 'mean_word_length': 4.6993318485523385, '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': '7127065', 'n_tokens_mistral': 969, 'n_tokens_neox': 874, 'n_words': 180}