<commit_before>sap.ui.define([
	"sap/ui/rta/enablement/elementActionTest"
], function(elementActionTest) {
	'use strict';

	var fnConfirmButtonIsRenamedWithNewValue = function (oButton, oViewAfterAction, assert) {
		assert.strictEqual(oViewAfterAction.byId("button").getText(),
			"New Option",
			"then the control has been renamed to the new value (New Option)");
	};

	var fnConfirmButtonIsRenamedWithOldValue = function (oUiComponent, oViewAfterAction, assert) {
		assert.strictEqual(oViewAfterAction.byId("button").getText(),
			"Option 1",
			"then the control has been renamed to the old value (Option 1)");
	};

	// Remove and reveal actions
	var fnConfirmButtonIsInvisible = function (oUiComponent, oViewAfterAction, assert) {
		assert.strictEqual(oViewAfterAction.byId("button").getVisible(), false, "then the button element is invisible");
	};

	var fnConfirmButtonIsVisible = function (oUiComponent, oViewAfterAction, assert) {
		assert.strictEqual(oViewAfterAction.byId("button").getVisible(), true, "then the button element is visible");
	};

	elementActionTest("Checking the remove action for Button", {
		xmlView: '<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns:wc="sap.ui.webc.main">"' +
		'<wc:Button id="button" />' +
		'</mvc:View>'
		,
		action: {
			name: "remove",
			controlId: "button"
		},
		afterAction: fnConfirmButtonIsInvisible,
		afterUndo: fnConfirmButtonIsVisible,
		afterRedo: fnConfirmButtonIsInvisible
	});

	elementActionTest("Checking the rename action for a Button", {
		xmlView: '<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns:m="sap.m">"' +
		'<m:Button text="Option 1" id="button" />' +
		'</mvc:View>'
		,
		action: {
			name: "rename",
			controlId: "button",
			parameter: function (oView) {
				return {
					newValue: 'New Option',
					renamedElement: oView.byId("button")
				};
			}
		},
		afterAction: fnConfirmButtonIsRenamedWithNewValue,
		afterUndo: fnConfirmButtonIsRenamedWithOldValue,
		afterRedo: fnConfirmButtonIsRenamedWithNewValue<commit_msg>[INTERNAL] sap.ui.webc.fiori: Button test<commit_after>sap.ui.define([
	"sap/ui/rta/enablement/elementActionTest"
], function(elementActionTest) {
	'use strict';

	var fnConfirmButtonIsRenamedWithNewValue = function (oButton, oViewAfterAction, assert) {
		assert.strictEqual(oViewAfterAction.byId("button").getText(),
			"New Option",
			"then the control has been renamed to the new value (New Option)");
	};

	var fnConfirmButtonIsRenamedWithOldValue = function (oUiComponent, oViewAfterAction, assert) {
		assert.strictEqual(oViewAfterAction.byId("button").getText(),
			"Option 1",
			"then the control has been renamed to the old value (Option 1)");
	};

	// Remove and reveal actions
	var fnConfirmButtonIsInvisible = function (oUiComponent, oViewAfterAction, assert) {
		assert.strictEqual(oViewAfterAction.byId("button").getVisible(), false, "then the button element is invisible");
	};

	var fnConfirmButtonIsVisible = function (oUiComponent, oViewAfterAction, assert) {
		assert.strictEqual(oViewAfterAction.byId("button").getVisible(), true, "then the button element is visible");
	};

	elementActionTest("Checking the remove action for Button", {
		xmlView: '<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns:wc="sap.ui.webc.main">"' +
		'<wc:Button id="button" />' +
		'</mvc:View>'
		,
		action: {
			name: "remove",
			controlId: "button"
		},
		afterAction: fnConfirmButtonIsInvisible,
		afterUndo: fnConfirmButtonIsVisible,
		afterRedo: fnConfirmButtonIsInvisible
	});

	elementActionTest("Checking the rename action for a Button", {
		xmlView: '<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns:wc="sap.ui.webc.main">"' +
		'<wc:Button text="Option 1" id="button" />' +
		'</mvc:View>'
		,
		action: {
			name: "rename",
			controlId: "button",
			parameter: function (oView) {
				return {
					newValue: 'New Option',
					renamedElement: oView.byId("button")
				};
			}
		},
		afterAction: fnConfirmButtonIsRenamedWithNewValue,
		afterUndo: fnConfirmButtonIsRenamedWithOldValue,
		afterRedo: fnConfirmButtonIsRenamedWithNewValue
{'fraction_non_alphanumeric': 0.13581164807930607, 'fraction_numerical': 0.001486988847583643, 'mean_word_length': 5.238021638330757, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '378233', 'n_tokens_mistral': 1464, 'n_tokens_neox': 1326, 'n_words': 280}