Skip to content

test(api): access model create and edit save nothing when refused - #383

Merged
saqibmanan merged 1 commit into
CIfrom
access-model-atomic
Nov 26, 2026
Merged

saqibmanan merged 1 commit into
CIfrom
access-model-atomic

Conversation

@saqibmanan

Copy link
Copy Markdown
Contributor

Covers DataSpaceBackend#316 (fix #320), which had no test beyond api_064's create-with-another-dataset's-file case.

api_074, five tests against dev, all pass:

  • create with an unknown field leaves no access model behind
  • edit with another dataset's file keeps the name and the existing resources
  • edit with an unknown field keeps the existing resources
  • a refused edit without an id leaves no access model behind
  • control: a valid edit still saves

Every edit sends the full input: the first draft left description and type out, so the backend refused it for the missing argument and the checks passed for the wrong reason. The refusals were checked by message ('Resource ... does not exist', 'Field ... does not exist'), and a guard fails the test if a refusal is a malformed request. Gated with deployed_pr(DataSpaceBackend#320).

Not shown failing: the fix is live on dev, and prod is read-only for tests, so there is no pre-fix backend to run it against.

@saqibmanan
saqibmanan merged commit a19d3cb into CI Nov 26, 2026
2 checks passed
@saqibmanan
saqibmanan deleted the access-model-atomic branch November 26, 2026 09:07
saqibmanan added a commit that referenced this pull request Nov 26, 2026
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.

1 participant