Skip to content

Commit 14a63cd

Browse files
committed
removed all lower case tags from specs
1 parent ed07a12 commit 14a63cd

File tree

14 files changed

+56
-143
lines changed

14 files changed

+56
-143
lines changed

ruby/hyper-component/lib/hyperstack/internal/component/tags.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module Tags
4141
end
4242
end
4343
else
44-
alias_method tag, tag.upcase
44+
#alias_method tag, tag.upcase
4545
end
4646
# end of deprecated code
4747
end

ruby/hyper-component/spec/client_features/children_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def self.get_children
99
component = Class.new do
1010
include Hyperstack::Component
1111
def render
12-
div { 'lorem' }
12+
DIV { 'lorem' }
1313
end
1414
end
1515
childs = [ Hyperstack::Component::ReactAPI.create_element('a'), Hyperstack::Component::ReactAPI.create_element('li') ]
@@ -63,7 +63,7 @@ def self.get_children
6363
component = Class.new do
6464
include Hyperstack::Component
6565
def render
66-
div { 'lorem' }
66+
DIV { 'lorem' }
6767
end
6868
end
6969
childs = [ Hyperstack::Component::ReactAPI.create_element('a') ]
@@ -101,7 +101,7 @@ def self.get_children
101101
component = Class.new do
102102
include Hyperstack::Component
103103
def render
104-
div { 'lorem' }
104+
DIV { 'lorem' }
105105
end
106106
end
107107
element = Hyperstack::Component::ReactAPI.create_element(component)

ruby/hyper-component/spec/client_features/component_spec.rb

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class Foo
186186
include Hyperstack::Component
187187
include Hyperstack::State::Observable
188188
def render
189-
div { @foo }
189+
DIV { @foo }
190190
end
191191
end
192192
end
@@ -250,7 +250,7 @@ def render
250250
end
251251

252252
def render
253-
div { StateFoo(drinks: @foo) }
253+
DIV { StateFoo(drinks: @foo) }
254254
end
255255

256256
after_mount do
@@ -372,7 +372,7 @@ class Lorem; end
372372
optional :bar, type: String
373373
end
374374

375-
def render; div; end
375+
def render; DIV; end
376376
end
377377
Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo, bar: 10, lorem: Lorem.new)
378378
end
@@ -390,7 +390,7 @@ class Lorem; end
390390
optional :bar, type: String
391391
end
392392

393-
def render; div; end
393+
def render; DIV; end
394394
end
395395
Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo, foo: 10, bar: '10', lorem: Lorem.new)
396396
end
@@ -409,7 +409,7 @@ class Foo
409409
end
410410

411411
def render
412-
div { params[:foo] + '-' + params[:bar]}
412+
DIV { params[:foo] + '-' + params[:bar]}
413413
end
414414
end
415415
end
@@ -560,16 +560,16 @@ class Foo
560560
include Hyperstack::Component
561561
param :foo
562562
def render
563-
div do
564-
span { params[:foo] }
563+
DIV do
564+
SPAN { params[:foo] }
565565
end
566566
end
567567
end
568568

569569
class Bar
570570
include Hyperstack::Component
571571
def render
572-
div do
572+
DIV do
573573
Hyperstack::Internal::Component::RenderingContext.render(Foo, foo: 'astring')
574574
end
575575
end
@@ -587,10 +587,11 @@ class Foo
587587
include Hyperstack::Component
588588

589589
def render
590-
div
590+
DIV() # this fails but DIV {} passes. Why?
591591
end
592592
end
593593
end
594+
binding.pry
594595
expect(page.body).to include('<div data-react-class="Hyperstack.Internal.Component.TopLevelRailsComponent" data-react-props="{&quot;render_params&quot;:{},&quot;component_name&quot;:&quot;Foo&quot;,&quot;controller&quot;:&quot;HyperstackTest&quot;}"><div></div></div>')
595596
end
596597

@@ -600,10 +601,10 @@ class Foo
600601
include Hyperstack::Component
601602

602603
def render
603-
div {
604+
DIV {
604605
p(class_name: 'foo')
605606
p
606-
div { 'lorem ipsum' }
607+
DIV { 'lorem ipsum' }
607608
p(id: '10')
608609
}
609610
end

ruby/hyper-component/spec/client_features/dsl_spec.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Foo < HyperComponent
4848
class Foo
4949
include Hyperstack::Component
5050
def render
51-
div { "hello" }
51+
DIV { "hello" }
5252
end
5353
end
5454
end
@@ -85,7 +85,7 @@ def render
8585
class Foo
8686
include Hyperstack::Component
8787
def render
88-
div { "hello".span; "goodby".span }
88+
DIV { "hello".span; "goodby".span }
8989
end
9090
end
9191
end
@@ -99,7 +99,7 @@ def render
9999
class Foo
100100
include Hyperstack::Component
101101
def render
102-
div { "hello".br }
102+
DIV { "hello".br }
103103
end
104104
end
105105
end
@@ -111,9 +111,9 @@ def render
111111
class Foo
112112
include Hyperstack::Component
113113
def render
114-
table {
115-
tbody {
116-
tr { "hello".td }
114+
TABLE {
115+
TBODY {
116+
TR { "hello".td }
117117
}
118118
}
119119
end
@@ -127,7 +127,7 @@ def render
127127
class Foo
128128
include Hyperstack::Component
129129
def render
130-
div { "hello".para }
130+
DIV { "hello".para }
131131
end
132132
end
133133
end
@@ -244,19 +244,19 @@ def render
244244
class Foo
245245
include Hyperstack::Component
246246
def render
247-
span(class: "the-class") { "hello" }
247+
SPAN(class: "the-class") { "hello" }
248248
end
249249
end
250250
end
251251
expect(page.body[-60..-19]).to include('<span class="the-class">hello</span>')
252252
end
253253

254-
it "can generate a unrendered node using the .as_node method" do # div { "hello" }.as_node
254+
it "can generate a unrendered node using the .as_node method" do # DIV { "hello" }.as_node
255255
mount 'Foo' do
256256
class Foo
257257
include Hyperstack::Component
258258
def render
259-
span(data: {size: 12}) { "hello".span.as_node.class.name }.as_node.render
259+
SPAN(data: {size: 12}) { "hello".span.as_node.class.name }.as_node.render
260260
end
261261
end
262262
end
@@ -268,7 +268,7 @@ def render
268268
class Foo
269269
include Hyperstack::Component
270270
def render
271-
div(dangerously_set_inner_HTML: { __html: "Hello and Goodby" })
271+
DIV(dangerously_set_inner_HTML: { __html: "Hello and Goodby" })
272272
end
273273
end
274274
end
@@ -280,7 +280,7 @@ def render
280280
class Foo
281281
include Hyperstack::Component
282282
def render
283-
div(data: { foo: :bar }, aria: { label: "title" })
283+
DIV(data: { foo: :bar }, aria: { label: "title" })
284284
end
285285
end
286286
end
@@ -292,7 +292,7 @@ def render
292292
class Foo
293293
include Hyperstack::Component
294294
def render
295-
div(title: { bar: :foo })
295+
DIV(title: { bar: :foo })
296296
end
297297
end
298298
end
@@ -305,7 +305,7 @@ class X2
305305
include Hyperstack::Component
306306
param :ele
307307
def render
308-
div do
308+
DIV do
309309
params[:ele].render
310310
params[:ele].render
311311
end
@@ -314,7 +314,7 @@ def render
314314
class Foo
315315
include Hyperstack::Component
316316
def render
317-
X2(ele: b { "hello" })
317+
X2(ele: B { "hello" })
318318
end
319319
end
320320
end

ruby/hyper-component/spec/client_features/element_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
it 'is renderable' do
1212
expect_evaluate_ruby do
1313
element = Hyperstack::Component::ReactAPI.create_element('span')
14-
div = JS.call(:eval, 'document.createElement("div")')
15-
Hyperstack::Component::ReactAPI.render(element, div)
16-
div.JS[:children].JS[0].JS[:tagName]
14+
a_div = JS.call(:eval, 'document.createElement("div")')
15+
Hyperstack::Component::ReactAPI.render(element, a_div)
16+
a_div.JS[:children].JS[0].JS[:tagName]
1717
end.to eq("SPAN")
1818
end
1919

ruby/hyper-component/spec/client_features/opal_jquery_extensions_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def render
7878
expect_evaluate_ruby do
7979
class Foo < HyperComponent
8080
def render
81-
div { 'hello' }
81+
DIV { 'hello' }
8282
end
8383
end
8484
Element[Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo)].html

ruby/hyper-component/spec/client_features/param_declaration_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Foo < HyperComponent
77
collect_other_params_as :foo
88

99
def render
10-
div { params.foo[:bar] }
10+
DIV { params.foo[:bar] }
1111
end
1212
end
1313
end
@@ -45,7 +45,7 @@ class Foo < HyperComponent
4545
param :foo
4646

4747
def render
48-
div { params.foo }
48+
DIV { params.foo }
4949
end
5050
end
5151
end
@@ -62,7 +62,7 @@ class Foo < HyperComponent
6262
param :foo4, default: :no_bar4
6363

6464
def render
65-
div { "#{params.foo1}-#{params.foo2}-#{params.foo3}-#{params.foo4}" }
65+
DIV { "#{params.foo1}-#{params.foo2}-#{params.foo3}-#{params.foo4}" }
6666
end
6767
end
6868
end
@@ -86,7 +86,7 @@ class Foo < HyperComponent
8686
param :foo2, type: String
8787

8888
def render
89-
div { "#{params.foo1}-#{params.foo2}" }
89+
DIV { "#{params.foo1}-#{params.foo2}" }
9090
end
9191
end
9292
end
@@ -102,7 +102,7 @@ class Foo2 < HyperComponent
102102
param :foo
103103
param :lorem, type: Lorem
104104
param :bar, default: nil, type: String
105-
def render; div; end
105+
def render; DIV; end
106106
end
107107

108108
Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo2, bar: 10, lorem: Lorem.new)
@@ -119,7 +119,7 @@ class Foo < HyperComponent
119119
param :lorem, type: Lorem
120120
param :bar, default: nil, type: String
121121

122-
def render; div; end
122+
def render; DIV; end
123123
end
124124
Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo, foo: 10, bar: '10', lorem: Lorem.new)
125125
end
@@ -282,8 +282,8 @@ def render
282282
Bar(foo: Native([`{bazwoggle: #{Foo.change_me}}`]))
283283
end
284284
end
285-
div = `document.createElement("div")`
286-
Hyperstack::Component::ReactAPI.render(Hyperstack::Component::ReactAPI.create_element(Foo, {}), div)
285+
a_div = `document.createElement("div")`
286+
Hyperstack::Component::ReactAPI.render(Hyperstack::Component::ReactAPI.create_element(Foo, {}), a_div)
287287
Foo.change_me! "updated"
288288
expect(`div.children[0].innerHTML`).to eq("updated")
289289
end

ruby/hyper-component/spec/client_features/react_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,17 +245,17 @@ def render
245245
end
246246
end
247247

248-
div = JS.call(:eval, 'document.createElement("div")')
249-
instance = Hyperstack::Component::ReactAPI.render(Hyperstack::Component::ReactAPI.create_element(Foo), div)
248+
a_div = JS.call(:eval, 'document.createElement("div")')
249+
instance = Hyperstack::Component::ReactAPI.render(Hyperstack::Component::ReactAPI.create_element(Foo), a_div)
250250
instance.is_a?(Foo)
251251
end.to be_truthy
252252
end
253253

254254
it "returns the actual DOM node" do
255255

256256
expect_evaluate_ruby do
257-
div = JS.call(:eval, 'document.createElement("div")')
258-
node = Hyperstack::Component::ReactAPI.render(Hyperstack::Component::ReactAPI.create_element('span') { "lorem" }, div)
257+
a_div = JS.call(:eval, 'document.createElement("div")')
258+
node = Hyperstack::Component::ReactAPI.render(Hyperstack::Component::ReactAPI.create_element('span') { "lorem" }, a_div)
259259
node.JS['nodeType']
260260
end.to eq(1)
261261
end
@@ -269,9 +269,9 @@ def render
269269
# trying to emulate that failed, becasue during render, _getOpalInstance was not yet defined.
270270
# it is defined only after render, when the component was mounted. So we call unmount after render
271271
expect_evaluate_ruby do
272-
div = JS.call(:eval, 'document.createElement("div")')
273-
Hyperstack::Component::ReactAPI.render(Hyperstack::Component::ReactAPI.create_element('span') { "lorem" }, div )
274-
Hyperstack::Component::ReactAPI.unmount_component_at_node(div)
272+
a_div = JS.call(:eval, 'document.createElement("div")')
273+
Hyperstack::Component::ReactAPI.render(Hyperstack::Component::ReactAPI.create_element('span') { "lorem" }, a_div )
274+
Hyperstack::Component::ReactAPI.unmount_component_at_node(a_div)
275275
end.to eq(true)
276276
end
277277
end

ruby/hyper-component/spec/client_features/refs_callback_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def render
4949
# client_option raise_on_js_errors: :off
5050
expect_evaluate_ruby do
5151
Foo.class_eval do
52-
def my_div=(div)
53-
Foo.bar = div
52+
def my_div=(a_div)
53+
Foo.bar = a_div
5454
end
5555

5656
def render

ruby/hyper-component/spec/client_features/tutorial_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class HelloMessage
77
include Hyperstack::Component
88
def render
9-
div { "Hello World!" }
9+
DIV { "Hello World!" }
1010
end
1111
end
1212
end
@@ -21,7 +21,7 @@ class HelloMessage2
2121
include Hyperstack::Component
2222
before_mount { @user_name = '@catmando' }
2323
def render
24-
div { "Hello #{@user_name}" }
24+
DIV { "Hello #{@user_name}" }
2525
end
2626
end
2727
end

0 commit comments

Comments
 (0)