-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Labels
area: model 📐Related to the core SDK modelsRelated to the core SDK modelsbugSomething isn't workingSomething isn't working
Description
Category
- Bug
Describe the bug
GetComments() used to return all comments. Now it is only returning 30 comments.
Steps to reproduce
- See code block below
- Add the following unit test to the PagesTests.cs in PnP.Core.Test project
- Run the test without mocking turned off.
- Assertion failure since it returns 30 comments instead of 45 that get added in this test.
[TestMethod]
public async Task PageCommentingTestOnlyReturn30Comments()
{
TestCommon.Instance.Mocking = false;
using (var context = await TestCommon.Instance.GetContextAsync(TestCommon.TestSite))
{
var newPage = await context.Web.NewPageAsync();
string pageName = TestCommon.GetPnPSdkTestAssetName("PageCommentingTest.aspx");
// Save the page
await newPage.SaveAsync(pageName);
// Publish the page, required before it can be liked
newPage.Publish();
// Get Page comments
var comments = newPage.GetComments();
Assert.IsTrue(comments.Length == 0);
var noCommentsAdded = 45;
foreach (var i in Enumerable.Range(1, noCommentsAdded))
{
// Add a comment
comments.Add($"Comment #: {i} added by unit test");
}
comments = newPage.GetComments();
// Expecting 45 but only 30 is returned.
Assert.IsTrue(comments.Length == noCommentsAdded);
// Delete the page
await newPage.DeleteAsync();
}
}
Expected behavior
GetComments() should return all comments like it used to.
Environment details (development & target environment)
- SDK version: 1.11.0
- OS: [e.g. Windows 10 | MacOS 10.15.x]
- SDK used in: [Console App]
- Framework: [.NET 7/8 ]
- Browser(s): [N/A]
- Tooling: [Visual Studio 2021]
- Additional details: **
Additional context
Thanks for your contribution! Sharing is caring.
mbice
Metadata
Metadata
Assignees
Labels
area: model 📐Related to the core SDK modelsRelated to the core SDK modelsbugSomething isn't workingSomething isn't working