Skip to content

Commit 225a70b

Browse files
🧪 [Test]: Exercise every command with live CRUD and context tests
Rewrite tests/Confluence.Tests.ps1 into a full integration suite that drives the module's own commands through create/read/update/delete for pages, folders, comments, labels, content properties and attachments, and reads spaces, permissions, properties, restrictions, users, blog posts and the raw REST entry point. Each command's processed object is logged with LogGroup so outputs are visible in the run log (matching the PSModule/GitHub test style). Add context-storage tests: profile fields, SecureString token, default and -ListAvailable contexts, multiple named contexts targeted with -Context, and config round-trip. Remove the #SkipTest:FunctionTest markers now that every public function is invoked by a test, so the source-code FunctionTest check passes without deferral warnings. Get-ConfluenceConfig now returns a defensive copy so callers cannot corrupt the in-memory configuration cache; changes still flow through Set-ConfluenceConfig.
1 parent 4a3ebf4 commit 225a70b

38 files changed

Lines changed: 642 additions & 90 deletions

src/functions/public/API/Invoke-ConfluenceRestMethod.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#Requires -Version 7.0
22
#Requires -Modules @{ ModuleName = 'Context'; ModuleVersion = '8.1.6'; MaximumVersion = '8.999.999' }
33

4-
#SkipTest:FunctionTest:Integration tests are added once the repository Confluence credentials are configured.
54
function Invoke-ConfluenceRestMethod {
65
<#
76
.SYNOPSIS

src/functions/public/Attachments/Add-ConfluenceAttachment.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#SkipTest:FunctionTest:Integration tests are added once the repository Confluence credentials are configured.
2-
function Add-ConfluenceAttachment {
1+
function Add-ConfluenceAttachment {
32
<#
43
.SYNOPSIS
54
Upload an attachment to a page (read:content-details and write:attachment).

src/functions/public/Attachments/Get-ConfluenceAttachment.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#SkipTest:FunctionTest:Integration tests are added once the repository Confluence credentials are configured.
2-
function Get-ConfluenceAttachment {
1+
function Get-ConfluenceAttachment {
32
<#
43
.SYNOPSIS
54
Get page attachments (read:attachment).

src/functions/public/Attachments/Remove-ConfluenceAttachment.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#SkipTest:FunctionTest:Integration tests are added once the repository Confluence credentials are configured.
2-
function Remove-ConfluenceAttachment {
1+
function Remove-ConfluenceAttachment {
32
<#
43
.SYNOPSIS
54
Delete an attachment (delete:attachment).

src/functions/public/Auth/Connect-Confluence.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#SkipTest:FunctionTest:Integration tests are added once the repository Confluence credentials are configured.
2-
function Connect-Confluence {
1+
function Connect-Confluence {
32
<#
43
.SYNOPSIS
54
Connect to Confluence and store a credential profile in the context vault.

src/functions/public/Auth/Disconnect-Confluence.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#SkipTest:FunctionTest:Integration tests are added once the repository Confluence credentials are configured.
2-
function Disconnect-Confluence {
1+
function Disconnect-Confluence {
32
<#
43
.SYNOPSIS
54
Remove a stored Confluence credential profile.

src/functions/public/Auth/Get-ConfluenceAccessibleResource.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#SkipTest:FunctionTest:Calls the public accessible-resources endpoint with a bearer token; covered by integration tests.
2-
function Get-ConfluenceAccessibleResource {
1+
function Get-ConfluenceAccessibleResource {
32
<#
43
.SYNOPSIS
54
List the Atlassian sites (resources) a token can reach.

src/functions/public/Auth/Get-ConfluenceContext.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#SkipTest:FunctionTest:Integration tests are added once the repository Confluence credentials are configured.
2-
function Get-ConfluenceContext {
1+
function Get-ConfluenceContext {
32
<#
43
.SYNOPSIS
54
Get a stored Confluence credential profile.

src/functions/public/BlogPosts/Get-ConfluenceBlogPost.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#SkipTest:FunctionTest:Integration tests are added once the repository Confluence credentials are configured.
2-
function Get-ConfluenceBlogPost {
1+
function Get-ConfluenceBlogPost {
32
<#
43
.SYNOPSIS
54
Get blog posts (read:blogpost).

src/functions/public/Comments/Add-ConfluenceComment.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#SkipTest:FunctionTest:Integration tests are added once the repository Confluence credentials are configured.
2-
function Add-ConfluenceComment {
1+
function Add-ConfluenceComment {
32
<#
43
.SYNOPSIS
54
Add a footer comment to a page (write:comment).

0 commit comments

Comments
 (0)