-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from PhlexUI/ch/migrate-typography
Migrate typography
- Loading branch information
Showing
18 changed files
with
139 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ex_ui/typography/typography_blockquote.rb → lib/rbui/typography/typography_blockquote.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/phlex_ui/typography/typography_h1.rb → lib/rbui/typography/typography_h1.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/phlex_ui/typography/typography_h2.rb → lib/rbui/typography/typography_h2.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/phlex_ui/typography/typography_h3.rb → lib/rbui/typography/typography_h3.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/phlex_ui/typography/typography_h4.rb → lib/rbui/typography/typography_h4.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...x_ui/typography/typography_inline_code.rb → ...rbui/typography/typography_inline_code.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...x_ui/typography/typography_inline_link.rb → ...rbui/typography/typography_inline_link.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/phlex_ui/typography/typography_large.rb → lib/rbui/typography/typography_large.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/phlex_ui/typography/typography_lead.rb → lib/rbui/typography/typography_lead.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lex_ui/typography/typography_list_item.rb → lib/rbui/typography/typography_list_item.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/phlex_ui/typography/typography_muted.rb → lib/rbui/typography/typography_muted.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/phlex_ui/typography/typography_p.rb → lib/rbui/typography/typography_p.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/phlex_ui/typography/typography_small.rb → lib/rbui/typography/typography_small.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# frozen_string_literal: true | ||
|
||
require "test_helper" | ||
|
||
class RBUI::TypographyTest < Minitest::Test | ||
include Phlex::Testing::ViewHelper | ||
|
||
def test_h1 | ||
output = phlex_context do | ||
RBUI.TypographyH1 { "This is an H1 title" } | ||
end | ||
|
||
assert_match("This is an H1 title", output) | ||
end | ||
|
||
def test_h2 | ||
output = phlex_context do | ||
RBUI.TypographyH2 { "This is an H2 title" } | ||
end | ||
|
||
assert_match("This is an H2 title", output) | ||
end | ||
|
||
def test_h3 | ||
output = phlex_context do | ||
RBUI.TypographyH3 { "This is an H3 title" } | ||
end | ||
|
||
assert_match("This is an H3 title", output) | ||
end | ||
|
||
def test_h4 | ||
output = phlex_context do | ||
RBUI.TypographyH4 { "This is an H4 title" } | ||
end | ||
|
||
assert_match("This is an H4 title", output) | ||
end | ||
|
||
def test_p | ||
output = phlex_context do | ||
RBUI.TypographyP { "This is an P tag" } | ||
end | ||
|
||
assert_match("This is an P tag", output) | ||
end | ||
|
||
def test_inline_link | ||
output = phlex_context do | ||
RBUI.TypographyInlineLink(href: "#") { "installation instructions" } | ||
end | ||
|
||
assert_match("installation instructions", output) | ||
end | ||
|
||
def test_list | ||
output = phlex_context do | ||
RBUI.TypographyList(items: [ | ||
"Phlex is fast", | ||
"Phlex is easy to use", | ||
"Phlex is awesome" | ||
]) | ||
end | ||
|
||
assert_match("Phlex is fast", output) | ||
end | ||
|
||
def test_numbered_list | ||
output = phlex_context do | ||
RBUI.TypographyList(items: [ | ||
"Copy", | ||
"Paste", | ||
"Customize" | ||
], numbered: true) | ||
end | ||
|
||
assert_match("Copy", output) | ||
end | ||
|
||
def test_inline_code | ||
output = phlex_context do | ||
RBUI.TypographyInlineCode { "This is an inline code block" } | ||
end | ||
|
||
assert_match("This is an inline code block", output) | ||
end | ||
|
||
def test_lead | ||
output = phlex_context do | ||
RBUI.TypographyLead { "A modal dialog that interrupts the user with important content and expects a response." } | ||
end | ||
|
||
assert_match("A modal dialog that interrupts", output) | ||
end | ||
|
||
def test_large | ||
output = phlex_context do | ||
RBUI.TypographyLarge { "Are you sure absolutely sure?" } | ||
end | ||
|
||
assert_match("Are you sure absolutely sure?", output) | ||
end | ||
|
||
def test_small | ||
output = phlex_context do | ||
RBUI.TypographySmall { "Email address" } | ||
end | ||
|
||
assert_match("Email address", output) | ||
end | ||
|
||
def test_muted | ||
output = phlex_context do | ||
RBUI.TypographyMuted { "Enter your email address." } | ||
end | ||
|
||
assert_match("Enter your email address.", output) | ||
end | ||
end |