Fix language server events to emit 'Updated' instead of 'Created' for updates (#19941)
* Initial plan * Fix language server events to emit 'Updated' instead of 'Created' for updates Co-authored-by: AndyButland <1993459+AndyButland@users.noreply.github.com> * Removed the added test and instead added the assertion of the added behaviour to an existing test. * Applied the same test and fix to the dictionary item service. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: AndyButland <1993459+AndyButland@users.noreply.github.com> Co-authored-by: Andy Butland <abutland73@gmail.com>
This commit is contained in:
@@ -362,6 +362,11 @@ internal sealed class DictionaryItemServiceTests : UmbracoIntegrationTest
|
||||
var result = await DictionaryItemService.UpdateAsync(item, Constants.Security.SuperUserKey);
|
||||
Assert.True(result.Success);
|
||||
|
||||
// Verify that the create and update dates can be used to distinguish between creates
|
||||
// and updates (as these fields are used in ServerEventSender to emit a "Created" or "Updated"
|
||||
// event.
|
||||
Assert.Greater(result.Result.UpdateDate, result.Result.CreateDate);
|
||||
|
||||
var updatedItem = await DictionaryItemService.GetAsync("Child");
|
||||
Assert.NotNull(updatedItem);
|
||||
|
||||
|
||||
@@ -191,6 +191,11 @@ internal sealed class LanguageServiceTests : UmbracoIntegrationTest
|
||||
Assert.IsTrue(result.Success);
|
||||
Assert.AreEqual(LanguageOperationStatus.Success, result.Status);
|
||||
|
||||
// Verify that the create and update dates can be used to distinguish between creates
|
||||
// and updates (as these fields are used in ServerEventSender to emit a "Created" or "Updated"
|
||||
// event.
|
||||
Assert.Greater(result.Result.UpdateDate, result.Result.CreateDate);
|
||||
|
||||
// re-get
|
||||
languageDaDk = await LanguageService.GetAsync(languageDaDk.IsoCode);
|
||||
Assert.NotNull(languageDaDk);
|
||||
|
||||
Reference in New Issue
Block a user