Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 43ce5b3

Browse files
committed
give spec a name mirroring lib
1 parent d89a656 commit 43ce5b3

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

spec/react/react_state_spec.rb

Lines changed: 0 additions & 22 deletions
This file was deleted.

spec/react/state_spec.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
require 'spec_helper'
2+
3+
if opal?
4+
describe 'React::State' do
5+
it "can created static exported states" do
6+
stub_const 'Foo', Class.new
7+
Foo.class_eval do
8+
include React::Component
9+
export_state(:foo) { 'bar' }
10+
end
11+
12+
expect(Foo.foo).to eq('bar')
13+
end
14+
15+
# these will all require async operations and testing to see if things get
16+
# re-rendered see spec_helper the "render" test method
17+
18+
# if Foo.foo is used during rendering then when Foo.foo changes we will
19+
# rerender
20+
it "sets up observers when exported states are read"
21+
22+
# React::State.set_state(object, attribute, value) +
23+
# React::State.get_state(object, attribute)
24+
it "can be accessed outside of react using get/set_state"
25+
end
26+
end

0 commit comments

Comments
 (0)