Skip to content

Commit

Permalink
Amend
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph committed Nov 25, 2024
1 parent 9940945 commit 4563d0c
Showing 1 changed file with 48 additions and 38 deletions.
86 changes: 48 additions & 38 deletions tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,45 +233,55 @@ fn inscription_page() {

let (inscription, reveal) = inscribe(&core, &ord);

TestServer::spawn_with_args(&core, &[]).assert_response_regex(
let response = ord.json_request(format!(
"/output/{}",
OutPoint {
txid: reveal,
vout: 0
}
));

assert_eq!(response.status(), StatusCode::OK);

let output: api::Output = serde_json::from_str(&response.text().unwrap()).unwrap();

TestServer::spawn_with_args(&core, &[]).assert_html(
format!("/inscription/{inscription}"),
format!(
".*<meta property=og:title content='Inscription 0'>.*
.*<meta property=og:image content='https://.*/favicon.png'>.*
.*<meta property=twitter:card content=summary>.*
<h1>Inscription 0</h1>
.*<iframe .* src=/preview/{inscription}></iframe>.*
<dl>
<dt>id</dt>
<dd class=collapse>{inscription}</dd>
<dt>address</dt>
<dd><a class=collapse href=/address/bc1.*>bc1.*</a></dd>
<dt>value</dt>
<dd>10000</dd>
<dt>preview</dt>
<dd><a href=/preview/{inscription}>link</a></dd>
<dt>content</dt>
<dd><a href=/content/{inscription}>link</a></dd>
<dt>content length</dt>
<dd>3 bytes</dd>
<dt>content type</dt>
<dd>text/plain;charset=utf-8</dd>
<dt>timestamp</dt>
<dd><time>1970-01-01 00:00:02 UTC</time></dd>
<dt>height</dt>
<dd><a href=/block/2>2</a></dd>
<dt>fee</dt>
<dd>138</dd>
<dt>reveal transaction</dt>
<dd><a class=collapse href=/tx/{reveal}>{reveal}</a></dd>
<dt>location</dt>
<dd><a class=collapse href=/satpoint/{reveal}:0:0>{reveal}:0:0</a></dd>
<dt>output</dt>
<dd><a class=collapse href=/output/{reveal}:0>{reveal}:0</a></dd>
<dt>offset</dt>
<dd>0</dd>
</dl>.*",
),
Chain::Mainnet,
InscriptionHtml {
chain: Chain::Mainnet,
charms: 0,
child_count: 0,
children: Vec::new(),
fee: 138,
height: 2,
inscription: Inscription {
content_type: Some("text/plain;charset=utf-8".as_bytes().into()),
body: Some("foo".as_bytes().into()),
..default()
},
id: inscription,
number: 0,
next: None,
output: Some(TxOut {
value: Amount::from_sat(10000),
script_pubkey: output.script_pubkey,
}),
parents: Vec::new(),
previous: None,
rune: None,
sat: None,
satpoint: SatPoint {
outpoint: OutPoint {
txid: reveal,
vout: 0,
},
offset: 0,
},
timestamp: "1970-01-01 00:00:02+00:00"
.parse::<DateTime<Utc>>()
.unwrap(),
},
);
}

Expand Down

0 comments on commit 4563d0c

Please sign in to comment.