? PR-4.4-dev Pending

User tests: Successful: 0 Unsuccessful: 0

avatar rajputanuj31
rajputanuj31
23 Mar 2023

add a test for Categories wise view of contacts in com_contact.

avatar joomla-cms-bot joomla-cms-bot - change - 23 Mar 2023
Category JavaScript Unit Tests
avatar rajputanuj31 rajputanuj31 - open - 23 Mar 2023
avatar rajputanuj31 rajputanuj31 - change - 23 Mar 2023
Status New Pending
avatar laoneo
laoneo - comment - 23 Mar 2023

Did you forget to commit the come in the db.js file? Also rename the function to db_createCategory as it creates only one category.

avatar rajputanuj31
rajputanuj31 - comment - 23 Mar 2023

Did you forget to commit the come in the db.js file? Also rename the function to db_createCategory as it creates only one category.

Sorry My bad.

avatar rajputanuj31 rajputanuj31 - change - 23 Mar 2023
Labels Added: ? PR-4.4-dev
avatar laoneo
laoneo - comment - 23 Mar 2023

There are also some code style issues.

avatar laoneo
laoneo - comment - 23 Mar 2023

The code to open the page must also be in a then statement, otherwise you can run into async issues, so something liek this should work (didn't test it actually and there are cs issues):

describe('Test that the Catagories of com_contact ', () => {
  it('can display a list of categories of contacts in menu item', () => {
    cy.db_createCategory({ title: 'automated test category 1', extension: 'com_contact' })
      .then((id) => cy.db_createContact({ name: 'automated test contact 1', catid: id }))
      .then() => cy.db_createCategory({ title: 'automated test category 2', extension: 'com_contact' })
      .then((id) => {
      cy.db_createContact({ name: 'automated test contact 2', catid: id });
      cy.db_createContact({ name: 'automated test contact 3', catid: id });
    }). then(() => {
    cy.visit('index.php?option=com_contact&view=categories&id=0');
    cy.contains('automated test category 1');
    cy.contains('automated test category 2');
    cy.get(':nth-child(2) > .page-header > .badge').contains('Contact Count: 1');
    cy.get(':nth-child(3) > .page-header > .badge').contains('Contact Count: 2');
});
  });
});
avatar laoneo
laoneo - comment - 23 Mar 2023

The test fails because you need to add some more default values to the db_createCategory function

avatar rajputanuj31
rajputanuj31 - comment - 23 Mar 2023

The test fails because you need to add some more default values to the db_createCategory function

Added more default values but don't know why still checks are failing?

avatar laoneo
laoneo - comment - 23 Mar 2023

Restartet drone, probably a server issue

avatar laoneo laoneo - change - 28 Mar 2023
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-03-28 13:51:38
Closed_By laoneo
avatar laoneo laoneo - close - 28 Mar 2023
avatar laoneo laoneo - merge - 28 Mar 2023
avatar laoneo
laoneo - comment - 28 Mar 2023

Thanks!

avatar rajputanuj31
rajputanuj31 - comment - 4 Apr 2023

Thanks a lot for merging it.

Add a Comment

Login with GitHub to post a comment