Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions templates/manifest.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"density": "5.0"
}
],
"start_url": "index.html",
"display": "minimal-ui",
"start_url": "./",
"display": "standalone",
"background_color": "#efefef",
"theme_color": "#efefef"
}
28 changes: 28 additions & 0 deletions test/render_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,32 @@ def test_force_regenerate_skips_cache

puts "✓ Force regeneration feature works correctly"
end

def test_manifest_pwa_settings
# Test that manifest.json is generated with correct PWA settings for iOS
require 'json'

# Ensure manifest exists
assert File.exist?('public/manifest.json'), "manifest.json should be generated"

# Parse and validate manifest content
manifest = JSON.parse(File.read('public/manifest.json'))

# Check display mode is "standalone" for proper iOS PWA behavior
assert_equal "standalone", manifest["display"],
"Display mode should be 'standalone' to prevent opening new tabs on iOS"

# Check start_url is properly set
assert_equal "./", manifest["start_url"],
"start_url should be './' for proper iOS PWA behavior"

# Verify essential manifest fields exist
assert manifest.key?("name"), "Manifest should have a name"
assert manifest.key?("short_name"), "Manifest should have a short_name"
assert manifest.key?("icons"), "Manifest should have icons"
assert manifest["icons"].is_a?(Array), "Icons should be an array"
assert !manifest["icons"].empty?, "Icons array should not be empty"

puts "✓ Manifest PWA settings are correctly configured for iOS"
end
end
Loading