? PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar heelc29
heelc29
1 Aug 2023

Summary of Changes

API tests for following endpoints:

  • GET: v1/contacts/:id
  • POST: v1/contacts/form/:id (issue param)
  • GET: v1/contacts/categories/:id
  • POST: v1/contacts/categories
  • PATCH: v1/contacts/categories/:id
  • GET: v1/fields/contacts/contact/:id
  • GET: v1/fields/contacts/mail
  • GET: v1/fields/contacts/mail/:id
  • POST: v1/fields/contacts/mail
  • PATCH: v1/fields/contacts/mail/:id
  • DELETE: v1/fields/contacts/mail/:id
  • GET: v1/fields/contacts/categories
  • GET: v1/fields/contacts/categories/:id
  • POST: v1/fields/contacts/categories
  • PATCH: v1/fields/contacts/categories/:id
  • DELETE: v1/fields/contacts/categories/:id
  • GET: v1/fields/groups/contacts/contact/:id
  • GET: v1/fields/groups/contacts/mail
  • GET: v1/fields/groups/contacts/mail/:id
  • POST: v1/fields/groups/contacts/mail
  • PATCH: v1/fields/groups/contacts/mail/:id
  • DELETE: v1/fields/groups/contacts/mail/:id
  • GET: v1/fields/groups/contacts/categories
  • GET: v1/fields/groups/contacts/categories/:id
  • POST: v1/fields/groups/contacts/categories
  • PATCH: v1/fields/groups/contacts/categories/:id
  • DELETE: v1/fields/groups/contacts/categories/:id

fixed:

typo category:

  • POST: v1/contacts

syntax error:

  • POST: v1/fields/groups/contacts/contact
  • PATCH: v1/fields/groups/contacts/contact/:id
  • DELETE: v1/fields/groups/contacts/contact/:id

missing:

asset:

  • DELETE: v1/contacts/categories/:id

history:

  • GET: v1/contacts/:id/contenthistory
  • PATCH: v1/contacts/:id/contenthistory/keep
  • DELETE: v1/contacts/:id/contenthistory

Testing Instructions

code review; drone execute test

avatar joomla-cms-bot joomla-cms-bot - change - 1 Aug 2023
Category JavaScript Unit Tests
avatar heelc29 heelc29 - open - 1 Aug 2023
avatar heelc29 heelc29 - change - 1 Aug 2023
Status New Pending
avatar laoneo
laoneo - comment - 8 Aug 2023

Pr is looking good and drone is happy too, can we merge it?

avatar heelc29
heelc29 - comment - 8 Aug 2023

Some endpoints are missing ...

Delete category: fails because no asset item is created when insert category direct in database
History: fails because history is not created when insert category direct in database

Maybe an option is an combined test: create and delete category ...

If the pr is already ok then it will be ready to merge

In addition I found an issue for the endpoint POST: v1/contacts/form/:id. There is a problem to get the component parameters by the application and merge them with the contact parameter

/** @var SiteApplication $app */
$app = Factory::getContainer()->get(SiteApplication::class);
if (Factory::getApplication()->isClient('api')) {
// @todo: remove this
$app->loadLanguage();
$this->setState('contact.id', Factory::getApplication()->getInput()->post->getInt('id'));
} else {
$this->setState('contact.id', $app->getInput()->getInt('id'));
}
$this->setState('params', $app->getParams());

avatar heelc29 heelc29 - change - 8 Aug 2023
Labels Added: ? PR-4.4-dev
avatar laoneo
laoneo - comment - 9 Aug 2023

We can do the rest of the tests in followup pr's. Can you also make a pr for the contact issue you pointed out in the ContactModel?

avatar laoneo laoneo - change - 9 Aug 2023
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-08-09 06:40:47
Closed_By laoneo
avatar laoneo laoneo - close - 9 Aug 2023
avatar laoneo laoneo - merge - 9 Aug 2023
avatar laoneo
laoneo - comment - 9 Aug 2023

Thanks!

Add a Comment

Login with GitHub to post a comment