Merge remote-tracking branch 'parent/main' into upstream-20240828

This commit is contained in:
KMY 2024-08-28 20:26:35 +09:00
commit b39054ff3c
136 changed files with 1803 additions and 977 deletions

12
spec/system/about_spec.rb Normal file
View file

@ -0,0 +1,12 @@
# frozen_string_literal: true
require 'rails_helper'
describe 'About page' do
it 'visits the about page and renders the web app' do
visit about_path
expect(page)
.to have_css('noscript', text: /Mastodon/)
end
end

25
spec/system/home_spec.rb Normal file
View file

@ -0,0 +1,25 @@
# frozen_string_literal: true
require 'rails_helper'
describe 'Home page' do
context 'when signed in' do
before { sign_in Fabricate(:user) }
it 'visits the homepage and renders the web app' do
visit root_path
expect(page)
.to have_css('noscript', text: /Mastodon/)
end
end
context 'when not signed in' do
it 'visits the homepage and renders the web app' do
visit root_path
expect(page)
.to have_css('noscript', text: /Mastodon/)
end
end
end

View file

@ -0,0 +1,12 @@
# frozen_string_literal: true
require 'rails_helper'
describe 'Privacy policy page' do
it 'visits the privacy policy page and renders the web app' do
visit privacy_policy_path
expect(page)
.to have_css('noscript', text: /Mastodon/)
end
end

View file

@ -2,32 +2,45 @@
require 'rails_helper'
describe 'ShareEntrypoint', :js, :streaming do
describe 'Share page', :js, :streaming do
include ProfileStories
subject { page }
let(:email) { 'test@example.com' }
let(:password) { 'password' }
let(:confirmed_at) { Time.zone.now }
let(:finished_onboarding) { true }
before do
as_a_logged_in_user
before { as_a_logged_in_user }
it 'allows posting a new status' do
visit share_path
expect(page)
.to have_css('.modal-layout__mastodon')
.and have_css('div#mastodon-compose')
.and have_css('.compose-form__submit')
fill_in_form
expect(page)
.to have_css('.notification-bar-message', text: translations['compose.published.body'])
end
it 'can be used to post a new status' do
expect(subject).to have_css('div#mastodon-compose')
expect(subject).to have_css('.compose-form__submit')
status_text = 'This is a new status!'
def fill_in_form
within('.compose-form') do
fill_in "What's on your mind?", with: status_text
click_on 'Post'
fill_in translations['compose_form.placeholder'],
with: 'This is a new status!'
click_on translations['compose_form.publish']
end
end
expect(subject).to have_css('.notification-bar-message', text: 'Post published.')
def translations
# TODO: Extract to system spec helper for re-use?
JSON.parse(
Rails
.root
.join('app', 'javascript', 'mastodon', 'locales', 'en.json')
.read
)
end
end