Skip to content

test: cover ShareAccessComponent behaviors in spec#5233

Open
Ma77Ball wants to merge 1 commit into
apache:mainfrom
Ma77Ball:test/shareAccessSpec
Open

test: cover ShareAccessComponent behaviors in spec#5233
Ma77Ball wants to merge 1 commit into
apache:mainfrom
Ma77Ball:test/shareAccessSpec

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • Expand share-access.component.spec.ts from 4 routing-only tests to 44 tests grouped by behavior: ngOnInit, handleInputConfirm, onPaste, grantAccess, hasWriteAccess, verifyRevokeAccess/revokeAccess, changeAccessLevel, verifyPublish/verifyUnpublish, and the individual publish/unpublish methods.
  • Drive modal-confirmation flows by capturing the config passed to NzModalService.create and invoking the relevant nzFooter button's onClick, so each test asserts against the specific Confirm/Cancel path it cares about.
  • Parameterize the setupComponent helper with type, id, inWorkspace, and currentEmail overrides, and reset the TestBed in beforeEach so each test reconfigures providers (e.g., a WRITE access entry for hasWriteAccess, an already-published item for verifyPublish) without bleed-over.

Any related issues, documentation, or discussions?

Closes: #5223

How was this PR tested?

  • Ran yarn format:fix (touched the new spec only).
  • Ran yarn test --include="src/app/dashboard/component/user/share-access/share-access.component.spec.ts": 44/44 passing.

Was this PR authored or co-authored using generative AI tooling?

Co-authored with Claude Opus 4.7 in compliance with ASF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add spec coverage for share-access.component.ts

1 participant