Files
psf-memo/psf-memo-client/acceptance/lib/render-like-result.js
T
Chris Troutner a0040f98c1 Implement like broadcast result modal
Keep the like/tip modal open after a successful like and show a broadcast
result instead of closing: the success message, the like transaction id, and
a link to that transaction on bch.loping.net that opens in a new tab. The
like count and filled heart update immediately, and dismissing the result
closes the modal. The result state lives on the testable LikeTipPage
controller; a server-renderable LikeResult component backs the modal and the
acceptance adapter, with acceptance step handlers for the new wording.

By coder.
2026-09-16 11:41:49 -07:00

21 lines
722 B
JavaScript

/*
Acceptance rendering adapter for the like broadcast result.
Renders the same LikeResult component the browser uses to a static HTML
string, so acceptance assertions can inspect the success message, the like
transaction id, and the block explorer link without running a browser.
*/
'use strict'
const React = require('react')
const ReactDOMServer = require('react-dom/server')
const LikeResult = require('../../src/components/post-feed/like-result')
function renderLikeResult ({ txid = '', message = '', explorerUrl = '' } = {}) {
const element = React.createElement(LikeResult, { txid, message, explorerUrl })
return ReactDOMServer.renderToStaticMarkup(element)
}
module.exports = { renderLikeResult }