Added deliveries workspace view to the webhook details workspace (#18175)
* Added deliveries workspace view to the webhook details workspace. * Front-end linting fixes. * rename to unique * update filter value * make delivery feature folder * move delivery workspace view for delivery feature folder * correct details workspace view label and pathname to match name * remove unused alias * use singular form to align naming * remove pagination as the default collection kind already includes this * show icon * remove double registration * add observables for webhook data, add get methods + add jsdocs * align UX with languages * remove hardcoded fake name + make url the link * remove redundant url in table * render status code as tag * use tags for enabled/disabled webhook state to align with users * make the name more explicit * move webhook root to a feature folder * export consts * fix webhook collection pagination * move menu item manifests into root folder * move webhook delivery filering responsibility from repo to workspace view * reorganize * move workspace * fix import * move entity actions * export delivery consts * dot not export const * rename folder * update name * make event feature folder * export consts * move repository files * more clean up * split types * add deprecation warning for a temp method * bring back url to deliveries table --------- Co-authored-by: Mads Rasmussen <madsr@hey.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Globalization;
|
||||
using System.Globalization;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Cms.Core;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
@@ -18,6 +18,7 @@ public class WebhookLogServiceTests : UmbracoIntegrationTest
|
||||
[Test]
|
||||
public async Task Can_Create_And_Get()
|
||||
{
|
||||
var webHookKey = Guid.NewGuid();
|
||||
var createdWebhookLog = await WebhookLogService.CreateAsync(new WebhookLog
|
||||
{
|
||||
Date = DateTime.UtcNow,
|
||||
@@ -27,24 +28,32 @@ public class WebhookLogServiceTests : UmbracoIntegrationTest
|
||||
StatusCode = "200",
|
||||
RetryCount = 0,
|
||||
Key = Guid.NewGuid(),
|
||||
WebhookKey = webHookKey
|
||||
});
|
||||
|
||||
|
||||
var webhookLogsPaged = await WebhookLogService.Get();
|
||||
var allWebhookLogsPaged = await WebhookLogService.Get();
|
||||
var specificWebhookLogsPaged = await WebhookLogService.Get(webHookKey);
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.IsNotNull(webhookLogsPaged);
|
||||
Assert.IsNotEmpty(webhookLogsPaged.Items);
|
||||
Assert.AreEqual(1, webhookLogsPaged.Items.Count());
|
||||
var webhookLog = webhookLogsPaged.Items.First();
|
||||
Assert.AreEqual(createdWebhookLog.Date.ToString(CultureInfo.InvariantCulture), webhookLog.Date.ToString(CultureInfo.InvariantCulture));
|
||||
Assert.AreEqual(createdWebhookLog.EventAlias, webhookLog.EventAlias);
|
||||
Assert.AreEqual(createdWebhookLog.RequestBody, webhookLog.RequestBody);
|
||||
Assert.AreEqual(createdWebhookLog.ResponseBody, webhookLog.ResponseBody);
|
||||
Assert.AreEqual(createdWebhookLog.StatusCode, webhookLog.StatusCode);
|
||||
Assert.AreEqual(createdWebhookLog.RetryCount, webhookLog.RetryCount);
|
||||
Assert.AreEqual(createdWebhookLog.Key, webhookLog.Key);
|
||||
AssertGetResult(createdWebhookLog, allWebhookLogsPaged);
|
||||
AssertGetResult(createdWebhookLog, specificWebhookLogsPaged);
|
||||
|
||||
static void AssertGetResult(WebhookLog createdWebhookLog, PagedModel<WebhookLog> allWebhookLogsPaged)
|
||||
{
|
||||
Assert.IsNotNull(allWebhookLogsPaged);
|
||||
Assert.IsNotEmpty(allWebhookLogsPaged.Items);
|
||||
Assert.AreEqual(1, allWebhookLogsPaged.Items.Count());
|
||||
var webhookLog = allWebhookLogsPaged.Items.First();
|
||||
Assert.AreEqual(createdWebhookLog.Date.ToString(CultureInfo.InvariantCulture), webhookLog.Date.ToString(CultureInfo.InvariantCulture));
|
||||
Assert.AreEqual(createdWebhookLog.EventAlias, webhookLog.EventAlias);
|
||||
Assert.AreEqual(createdWebhookLog.RequestBody, webhookLog.RequestBody);
|
||||
Assert.AreEqual(createdWebhookLog.ResponseBody, webhookLog.ResponseBody);
|
||||
Assert.AreEqual(createdWebhookLog.StatusCode, webhookLog.StatusCode);
|
||||
Assert.AreEqual(createdWebhookLog.RetryCount, webhookLog.RetryCount);
|
||||
Assert.AreEqual(createdWebhookLog.Key, webhookLog.Key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user