tech(remaniement): isole la logique de rendu au champs_subtree_component
This commit is contained in:
parent
3b5d1bd55b
commit
88abefb370
10 changed files with 137 additions and 191 deletions
|
@ -1,6 +1,7 @@
|
|||
describe TreeableConcern do
|
||||
class ChampsToTree
|
||||
include TreeableConcern
|
||||
|
||||
attr_reader :root
|
||||
def initialize(champs:, root_depth:)
|
||||
@root = to_tree(champs:, root_depth:)
|
||||
|
@ -43,8 +44,8 @@ describe TreeableConcern do
|
|||
it 'wraps champs within preview header section' do
|
||||
expect(subject.size).to eq(2)
|
||||
expect(subject).to eq([
|
||||
[ header_1, champ_explication, champ_text ],
|
||||
[ header_2, champ_textarea ]
|
||||
[header_1, champ_explication, champ_text],
|
||||
[header_2, champ_textarea]
|
||||
])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue