upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/grasp-audit/src/fixtures.rs
diff options
context:
space:
mode:
Diffstat (limited to 'grasp-audit/src/fixtures.rs')
-rw-r--r--grasp-audit/src/fixtures.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/grasp-audit/src/fixtures.rs b/grasp-audit/src/fixtures.rs
index e34ee6d..71d64d3 100644
--- a/grasp-audit/src/fixtures.rs
+++ b/grasp-audit/src/fixtures.rs
@@ -199,18 +199,25 @@ impl<'a> TestContext<'a> {
199 } 199 }
200 200
201 FixtureKind::RepoWithIssue => { 201 FixtureKind::RepoWithIssue => {
202 // First create repo 202 use nostr_sdk::prelude::*;
203
204 // First create and send repo
203 let test_name = format!("fixture-{:?}-{}", FixtureKind::ValidRepo, &uuid::Uuid::new_v4().to_string()[..8]); 205 let test_name = format!("fixture-{:?}-{}", FixtureKind::ValidRepo, &uuid::Uuid::new_v4().to_string()[..8]);
204 let repo = self.client.create_repo_announcement(&test_name).await?; 206 let repo = self.client.create_repo_announcement(&test_name).await?;
205 self.client.send_event(repo.clone()).await?; 207 self.client.send_event(repo.clone()).await?;
206 208
207 // Then create issue referencing it 209 // Then create issue referencing it - this will have 'a' tag to repo
208 self.client.create_issue( 210 // Note: We build the issue but DON'T send it here - the caller will send it
211 let issue = self.client.create_issue(
209 &repo, 212 &repo,
210 "Test Issue", 213 "Test Issue",
211 "Issue content for testing", 214 "Issue content for testing",
212 vec![], 215 vec![],
213 ) 216 )?;
217
218 // Return the issue - tests can extract repo reference from its 'a' tag
219 // The caller (create_fresh/get_or_create_shared) will send this event
220 Ok(issue)
214 } 221 }
215 222
216 FixtureKind::RepoWithComment => { 223 FixtureKind::RepoWithComment => {