refactor: Modernize CI with Appraisal gem and consolidate workflows

- Add Appraisal gem for managing multiple test gemfiles
- Create test matrix for Rails 6.1-8.0 and ActiveAdmin 2.9-4.x
- Consolidate multiple workflow files into single ci.yml
- Use matrix strategy to test across Ruby 3.0-3.3
- Remove deprecated individual workflow files
- Add gemfiles/ to gitignore as they're generated
- Improve backward compatibility support
Этот коммит содержится в:
Gleb Tv
2025-09-24 12:47:46 +03:00
родитель 194518dea4
Коммит c26aef65ab
24 изменённых файлов: 1324 добавлений и 470 удалений

Просмотреть файл

@@ -18,7 +18,7 @@ module Shared
end
def select_all
content_element.send_keys([:control, "a"])
content_element.send_keys([:control, 'a'])
self
end

Просмотреть файл

@@ -7,6 +7,7 @@ module JavaScriptHelper
loop do
quill_loaded = page.evaluate_script('typeof Quill !== "undefined"')
break if quill_loaded
sleep 0.1
end
end
@@ -20,6 +21,7 @@ module JavaScriptHelper
typeof getQuillEditorByElementId === 'function'
JS
break if init_loaded
sleep 0.1
end
end
@@ -93,6 +95,7 @@ module JavaScriptHelper
def quill_has_content?(text, index = 0)
content = get_quill_content(index)
return false unless content
content.include?(text)
end
@@ -115,4 +118,4 @@ end
RSpec.configure do |config|
config.include JavaScriptHelper, type: :system
end
end

Просмотреть файл

@@ -4,7 +4,7 @@ module StringCleanMultiline
refine String do
def clean_multiline
# Get rid of newlines and indentation spaces
strip.gsub(/\s*\n\s*/, "")
strip.gsub(/\s*\n\s*/, '')
end
end
end

Просмотреть файл

@@ -2,12 +2,10 @@
require 'rails_helper'
RSpec.describe 'CSS Loading', type: :system do
RSpec.describe 'CSS Loading' do
before do
# Create an admin user if authentication is enabled
if defined?(AdminUser)
AdminUser.create!(email: 'admin@example.com', password: 'password')
end
AdminUser.create!(email: 'admin@example.com', password: 'password') if defined?(AdminUser)
end
context 'when loading Quill editor CSS' do
@@ -32,10 +30,11 @@ RSpec.describe 'CSS Loading', type: :system do
# Ensure no CDN URLs
quill_stylesheets.each do |href|
next if href == 'inline'
expect(href).not_to match(%r{https?://cdn})
expect(href).not_to match(%r{jsdelivr})
expect(href).not_to match(%r{unpkg})
expect(href).to match(%r{/assets/}) if href != 'inline'
expect(href).not_to include('jsdelivr')
expect(href).not_to include('unpkg')
expect(href).to include('/assets/')
end
end
@@ -79,20 +78,27 @@ RSpec.describe 'CSS Loading', type: :system do
# Check that Quill styles are applied
editor_styles = page.evaluate_script(<<~JS)
(function() {
const editor = document.querySelector('.ql-container');
if (!editor) return null;
const styles = window.getComputedStyle(editor);
const container = document.querySelector('.ql-container');
const editor = document.querySelector('.ql-editor');
if (!container || !editor) return null;
const containerStyles = window.getComputedStyle(container);
const editorStyles = window.getComputedStyle(editor);
return {
position: styles.position,
display: styles.display,
hasBackground: styles.backgroundColor !== '' && styles.backgroundColor !== 'rgba(0, 0, 0, 0)'
containerDisplay: containerStyles.display,
containerBorderWidth: parseFloat(containerStyles.borderTopWidth || '0'),
editorBackground: editorStyles.backgroundColor,
editorPadding: editorStyles.paddingTop
};
})()
JS
expect(editor_styles).not_to be_nil
expect(editor_styles['display']).not_to eq('none')
expect(editor_styles['hasBackground']).to be true
expect(editor_styles['containerDisplay']).not_to eq('none')
expect(editor_styles['containerBorderWidth']).to be > 0
expect(editor_styles['editorBackground']).not_to eq('rgba(0, 0, 0, 0)')
expect(editor_styles['editorPadding']).not_to eq('0px')
# Check toolbar styles
toolbar_visible = page.evaluate_script(<<~JS)
@@ -124,7 +130,7 @@ RSpec.describe 'CSS Loading', type: :system do
JS
# Check for bubble theme CSS (if included)
bubble_theme_loaded = page.evaluate_script(<<~JS)
_bubble_theme_loaded = page.evaluate_script(<<~JS)
Array.from(document.styleSheets).some(sheet => {
try {
return sheet.cssRules && Array.from(sheet.cssRules).some(rule =>
@@ -159,4 +165,4 @@ RSpec.describe 'CSS Loading', type: :system do
expect(quill_css_count).to be <= 1
end
end
end
end

Просмотреть файл

@@ -31,7 +31,7 @@ RSpec.describe 'Quill editor' do
it 'edits some content using the editor' do
editor.select_all
editor.toggle_link
editor.tooltip_editing.send_keys(["https://blocknot.es", :return])
editor.tooltip_editing.send_keys(['https://blocknot.es', :return])
editor << :right << :return << 'More content'
editor.toggle_bold
@@ -49,18 +49,18 @@ RSpec.describe 'Quill editor' do
editor << 'code block enabled' << :return
editor.toggle_code_block
editor << "Some text"
editor << 'Some text'
editor.toggle_sub
editor << "sub text"
editor << 'sub text'
editor.toggle_sub
editor << " More text"
editor << ' More text'
editor.toggle_super
editor << "sup text"
editor << 'sup text'
editor.toggle_super
editor << :return
editor.open_dropdown(:align).toggle_align_right
editor << "Text aligned on the right"
editor << 'Text aligned on the right'
expect(editor.content).to eq <<~HTML.clean_multiline
<p><a href="https://blocknot.es" rel="noopener noreferrer" target="_blank">Some content</a></p>

Просмотреть файл

@@ -17,7 +17,7 @@ RSpec.describe 'Quill JS' do
Admin::Posts::EditPage.new(path: path).load
end
it "returns the available editors", :aggregate_failures do
it 'returns the available editors', :aggregate_failures do
editors_count = page.evaluate_script('window.getQuillEditors().length')
expect(editors_count).to eq 2
@@ -40,7 +40,7 @@ RSpec.describe 'Quill JS' do
Admin::Posts::EditPage.new(path: path).load
end
it "returns the expected editor instance" do
it 'returns the expected editor instance' do
expected_element = find('#post_description > .ql-container')
editor = page.evaluate_script('window.getQuillEditorByIndex(1).container')
expect(editor).to eq expected_element
@@ -56,7 +56,7 @@ RSpec.describe 'Quill JS' do
Admin::Posts::EditPage.new(path: path).load
end
it "returns the expected editor instance" do
it 'returns the expected editor instance' do
expected_element = find('#post_description > .ql-container')
editor = page.evaluate_script('window.getQuillEditorByElementId("post_description").container')
expect(editor).to eq expected_element