mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Use to_json in simple view hash data-props build locations (#38218)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
= render_initial_state
|
||||
= vite_typescript_tag 'application.ts', crossorigin: 'anonymous'
|
||||
|
||||
.notranslate.app-holder#mastodon{ data: { props: Oj.dump(default_props) } }
|
||||
.notranslate.app-holder#mastodon{ data: { props: default_props.to_json } }
|
||||
%noscript
|
||||
= image_tag frontend_asset_path('images/logo.svg'), alt: 'Mastodon'
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
= render_initial_state
|
||||
= vite_typescript_tag 'share.tsx', crossorigin: 'anonymous'
|
||||
|
||||
#mastodon-compose{ data: { props: Oj.dump(default_props) } }
|
||||
#mastodon-compose{ data: { props: default_props.to_json } }
|
||||
|
||||
@@ -1 +1 @@
|
||||
#mastodon-status{ data: { props: Oj.dump(default_props.merge(id: @status.id.to_s)) } }
|
||||
#mastodon-status{ data: { props: default_props.merge(id: @status.id.to_s).to_json } }
|
||||
|
||||
@@ -41,6 +41,8 @@ RSpec.describe 'Status embed' do
|
||||
.to have_http_status(200)
|
||||
expect(response.parsed_body.at('body.embed'))
|
||||
.to be_present
|
||||
expect(response.parsed_body.at('#mastodon-status')['data-props'])
|
||||
.to eq({ locale: 'en', id: status.id.to_s }.to_json)
|
||||
expect(response.headers).to include(
|
||||
'Vary' => 'Accept, Accept-Language, Cookie',
|
||||
'Cache-Control' => include('public'),
|
||||
|
||||
@@ -12,6 +12,8 @@ RSpec.describe 'Home page' do
|
||||
expect(page)
|
||||
.to have_css('noscript', text: /Mastodon/)
|
||||
.and have_css('body', class: 'app-body')
|
||||
expect(find('.app-holder#mastodon')['data-props'])
|
||||
.to eq('{"locale":"en"}')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ RSpec.describe 'Share page', :js, :streaming do
|
||||
.to have_css('.modal-layout__mastodon')
|
||||
.and have_css('div#mastodon-compose')
|
||||
.and have_css('.compose-form__submit')
|
||||
expect(find_by_id('mastodon-compose')['data-props'])
|
||||
.to eq('{"locale":"en"}')
|
||||
|
||||
fill_in_form
|
||||
|
||||
|
||||
Reference in New Issue
Block a user