<commit_before>var utils = require('./utils.js');

describe('adming configure custom texts', function() {
  it('should perform custom texts configuration', function() {
    browser.setLocation('admin/content');
    element(by.cssContainingText("a", "Texts customization")).click();

    expect(element(by.model('vars.language_to_customize')).sendKeys('English'));
    element(by.cssContainingText('option', 'Whistleblowing disabled')).click();
    expect(element(by.model('vars.custom_text')).clear().sendKeys('Submissions disabled'));

    // save settings
    element(by.id('addCustomTextButton')).click().then(function() {
      browser.get('/');
      expect(browser.isElementPresent(element(by.cssContainingText("button", "Whistleblowing disabled")))).toBe(false);
      expect(browser.isElementPresent(element(by.cssContainingText("button", "Submissions disabled")))).toBe(true);
    });

    utils.login_admin();

    browser.setLocation('admin/content');
    element(by.cssContainingText("a", "Texts customization")).click();

    // save settings
    element(by.css('.deleteCustomTextButton')).click().then(function() {
      browser.get('/');
      expect(browser.isElementPresent(element(by.cssContainingText("button", "Submissions disabled")))).toBe(false);
      expect(browser.isElementPresent(element(by.cssContainingText("button", "Whistleblowing disabled")))).toBe(true);
    });
  });
});<commit_msg>Align client/tests/end2end/test-admin-configure-custom-texts.js to latest development<commit_after>var utils = require('./utils.js');

describe('adming configure custom texts', function() {
  it('should perform custom texts configuration', function() {
    browser.setLocation('admin/content');
    element(by.cssContainingText("a", "Texts customization")).click();

    expect(element(by.model('vars.language_to_customize')).sendKeys('English'));
    element(by.cssContainingText('option', 'Submissions disabled')).click();
    expect(element(by.model('vars.custom_text')).clear().sendKeys('Whistleblowing disabled'));

    // save settings
    element(by.id('addCustomTextButton')).click().then(function() {
      browser.get('/');
      expect(browser.isElementPresent(element(by.cssContainingText("button", "Submissions disabled")))).toBe(false);
      expect(browser.isElementPresent(element(by.cssContainingText("button", "Whistleblowing disabled")))).toBe(true);
    });

    utils.login_admin();

    browser.setLocation('admin/content');
    element(by.cssContainingText("a", "Texts customization")).click();

    // save settings
    element(by.css('.deleteCustomTextButton')).click().then(function() {
      browser.get('/');
      expect(browser.isElementPresent(element(by.cssContainingText("button", "Whistleblowing disabled")))).toBe(false);
      expect(browser.isElementPresent(element(by.cssContainingText("button", "Submissions disabled")))).toBe(true);
    });
  });
});
{'fraction_non_alphanumeric': 0.18019257221458046, 'fraction_numerical': 0.000343878954607978, 'mean_word_length': 5.749419953596288, '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': '6740608', 'n_tokens_mistral': 830, 'n_tokens_neox': 817, 'n_words': 102}