<commit_before>/// <reference types="Cypress" />
context('Partial View Macro Files', () => {

  beforeEach(() => {
    cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
  });

  it('Create new partial view macro', () => {
    const name = "TestPartialViewMacro";
    const fileName = name + ".cshtml";

   cy.umbracoEnsurePartialViewMacroFileNameNotExists(fileName);
   cy.umbracoEnsureMacroNameNotExists(name);

    cy.umbracoSection('settings');
    cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");

    cy.umbracoTreeItem("settings", ["Partial View Macro Files"]).rightclick();

    cy.umbracoContextMenuAction("action-create").click();
    cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-label").click();

    //Type name
    cy.umbracoEditorHeaderName(name);

    //Save
    cy.get('.btn-success').click();

    //Assert
    cy.umbracoSuccessNotification().should('be.visible');

    //Clean up
    cy.umbracoEnsurePartialViewMacroFileNameNotExists(fileName);
    cy.umbracoEnsureMacroNameNotExists(name);
  });

  it('Create new partial view macro without macro', () => {
    const name = "TestPartialMacrolessMacro";
    const fileName = name + ".cshtml";

    cy.umbracoEnsurePartialViewMacroFileNameNotExists(fileName);
    cy.umbracoEnsureMacroNameNotExists(fileName);

    cy.umbracoSection('settings');
    cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");

    cy.umbracoTreeItem("settings", ["Partial View Macro Files"]).rightclick();

    cy.umbracoContextMenuAction("action-create").click();
    cy.get('.menu-label').eq(1).click();

    // Type name
    cy.umbracoEditorHeaderName(name);

    // Save
    cy.get('.btn-success').click();

    // Assert
    cy.umbracoSuccessNotification().should('be.visible');

    // Clean
    cy.umbracoEnsurePartialViewMacroFileNameNotExists(fileName);
    cy.umbracoEnsureMacroNameNotExists(name);
  });

});<commit_msg>Test partial view macro from snippet<commit_after>/// <reference types="Cypress" />
context('Partial View Macro Files', () => {

  beforeEach(() => {
    cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
  });

  it('Create new partial view macro', () => {
    const name = "TestPartialViewMacro";
    const fileName = name + ".cshtml";

   cy.umbracoEnsurePartialViewMacroFileNameNotExists(fileName);
   cy.umbracoEnsureMacroNameNotExists(name);

    cy.umbracoSection('settings');
    cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");

    cy.umbracoTreeItem("settings", ["Partial View Macro Files"]).rightclick();

    cy.umbracoContextMenuAction("action-create").click();
    cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-label").click();

    //Type name
    cy.umbracoEditorHeaderName(name);

    //Save
    cy.get('.btn-success').click();

    //Assert
    cy.umbracoSuccessNotification().should('be.visible');

    //Clean up
    cy.umbracoEnsurePartialViewMacroFileNameNotExists(fileName);
    cy.umbracoEnsureMacroNameNotExists(name);
  });

  it('Create new partial view macro without macro', () => {
    const name = "TestPartialMacrolessMacro";
    const fileName = name + ".cshtml";

    cy.umbracoEnsurePartialViewMacroFileNameNotExists(fileName);
    cy.umbracoEnsureMacroNameNotExists(fileName);

    cy.umbracoSection('settings');
    cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");

    cy.umbracoTreeItem("settings", ["Partial View Macro Files"]).rightclick();

    cy.umbracoContextMenuAction("action-create").click();
    cy.get('.menu-label').eq(1).click();

    // Type name
    cy.umbracoEditorHeaderName(name);

    // Save
    cy.get('.btn-success').click();

    // Assert
    cy.umbracoSuccessNotification().should('be.visible');

    // Clean
    cy.umbracoEnsurePartialViewMacroFileNameNotExists(fileName);
    cy.umbracoEnsureMacroNameNotExists(name);
  });

  it('Create new partial view macro from snippet', () => {
      const name = "TestPartialFromSnippet";
      const fileName = name + ".cshtml";

      cy.umbracoEnsureMacroNameNotExists(fileName);
      cy.umbracoEnsureMacroNameNotExists(fileName);

      cy.umbracoSection('settings');
      cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");

      cy.umbracoTreeItem("settings", ["Partial View Macro Files"]).rightclick();

      cy.umbracoContextMenuAction("action-create").click();
      cy.get('.menu-label').eq(2).click();

      // Select snippet
      cy.get('.menu-label').eq(1).click();

      // Type name
      cy.umbracoEditorHeaderName(name);

      // Save
      cy.get('.btn-success').click();

      // Assert
      cy.umbracoSuccessNotification().should('be.visible');

      // Clean
      cy.umbracoEnsurePartialViewMacroFileNameNotExists(fileName);
      cy.umbracoEnsureMacroNameNotExists(name);
  });

});
{'fraction_non_alphanumeric': 0.16331860184813177, 'fraction_numerical': 0.0008035355564483728, 'mean_word_length': 3.9889779559118237, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '4158369', 'n_tokens_mistral': 1573, 'n_tokens_neox': 1559, 'n_words': 222}