Skip to content

Commit f83964d

Browse files
committed
docs: Add test methods docs
1 parent 4661c31 commit f83964d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/e2e/support/confluence.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ function createConfluenceClient() {
1616
});
1717
}
1818

19+
/**
20+
* Returns the content of a Confluence page by its ID.
21+
* @param id Id of the page to get the content from
22+
* @returns Content of the page
23+
*/
1924
async function getPageContent(id: string) {
2025
const client = createConfluenceClient();
2126
const content = await client.content.getContentById({
@@ -25,15 +30,24 @@ async function getPageContent(id: string) {
2530
return content;
2631
}
2732

33+
/**
34+
* Returns the confluence content properties of the README page
35+
*/
2836
async function getReadmePageContent() {
2937
return getPageContent(README_PAGE_ID);
3038
}
3139

40+
/**
41+
* Returns the Confluence children of the README page
42+
*/
3243
export async function getReadmePageChildren() {
3344
const content = await getReadmePageContent();
3445
return content.children?.page?.results;
3546
}
3647

48+
/**
49+
* Returns the confluence content properties of the CHANGELOG page
50+
*/
3751
async function getChangelogPageContent() {
3852
const readmeChildren = await getReadmePageChildren();
3953
const changelogId = readmeChildren ? readmeChildren[0]?.id : undefined;
@@ -47,16 +61,25 @@ async function getChangelogPageContent() {
4761
return changelogContent;
4862
}
4963

64+
/**
65+
* Returns the body of the CHANGELOG page
66+
*/
5067
export async function getChangelogPageBody() {
5168
const content = await getChangelogPageContent();
5269
return content.body?.view?.value;
5370
}
5471

72+
/**
73+
* Returns the title of the CHANGELOG page
74+
*/
5575
export async function getChangelogPageTitle() {
5676
const content = await getChangelogPageContent();
5777
return content.title;
5878
}
5979

80+
/**
81+
* Returns the title of the README page
82+
*/
6083
export async function getReadmePageTitle() {
6184
const content = await getReadmePageContent();
6285
return content.title;

0 commit comments

Comments
 (0)