Skip to content

Commit

Permalink
Merge pull request #14284 from abpframework/enisn/cmskit-fix-tests
Browse files Browse the repository at this point in the history
CmsKit fix tests
  • Loading branch information
realLiangshiwei authored Oct 11, 2022
2 parents 5f9fd4c + 5682f68 commit d178a86
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,5 @@ public virtual async Task SetAsHomePageAsync(Guid id)
var page = await PageRepository.GetAsync(id);

await PageManager.SetHomePageAsync(page);

await PageRepository.UpdateAsync(page);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public virtual async Task SetHomePageAsync(Page page)
}

await PageRepository.UpdateManyAsync(currentHomePages);

await PageRepository.UpdateAsync(page);

page.SetIsHomePage(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ public async Task SetSlugAsync_ShouldThrowException_WithExistingSlug()
[Fact]
public async Task SetHomePageAsync_ShouldWorkProperly_IfExistHomePage()
{
var page = await pageRepository.GetAsync(testData.Page_1_Id);

await pageManager.SetHomePageAsync(page);
await WithUnitOfWorkAsync(async ()=>
{
var page = await pageRepository.GetAsync(testData.Page_1_Id);

await pageRepository.UpdateAsync(page);
await pageManager.SetHomePageAsync(page);
});

var page = await pageRepository.GetAsync(testData.Page_1_Id);
page.IsHomePage.ShouldBeTrue();

var pageSetAsHomePageAsFalse = await pageRepository.GetAsync(testData.Page_2_Id);
Expand Down

0 comments on commit d178a86

Please sign in to comment.