Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyper model's while_loading does not work when loading scopes #67

Closed
catmando opened this issue Nov 19, 2018 · 2 comments
Closed

Hyper model's while_loading does not work when loading scopes #67

catmando opened this issue Nov 19, 2018 · 2 comments
Labels
bug Something isn't working ready-to-release Internal Use Only: Has been fixed, specs passing and pushed to edge branch
Milestone

Comments

@catmando
Copy link
Contributor

catmando commented Nov 19, 2018

# add this to the while_loading spec, and watch it fail!
...
   FactoryBot.create(:user, first_name: 'Lily', last_name: 'DaDog')
   FactoryBot.create(:user, first_name: 'Coffee', last_name: 'Boxer')
...
it "while loading works with relationships" do
   ReactiveRecord::Operations::Fetch.semaphore.synchronize do
     mount "WhileLoadingTester", {}, no_wait: true do
       class MyComponent < HyperComponent
         render do
           SPAN { 'loading...' }
         end
       end
       class WhileLoadingTester < HyperComponent
         render do
           UL do
             User.each { |user| LI { user.last_name } }
           end
           .while_loading 'loading...'
         end
       end
     end
     expect(page).to have_content('loading...')
     expect(page).not_to have_content('DaDog', wait: 0)
   end
   expect(page).to have_content('DaDog')
   expect(page).not_to have_content('loading...', wait: 0)
 end

last line of spec fails...

@catmando
Copy link
Contributor Author

problem is that the WhileLoading assumes the number of loaded children stays constant. In this case it does not!

@catmando catmando added the bug Something isn't working label Nov 20, 2018
@catmando catmando changed the title Hyper model's while_loading does not work when loading scopes Hyper model's while_loading does not work with loading scopes Nov 20, 2018
@catmando catmando changed the title Hyper model's while_loading does not work with loading scopes Hyper model's while_loading does not work when loading scopes Nov 20, 2018
@catmando catmando added this to the alpha1.3 milestone Dec 7, 2018
@catmando
Copy link
Contributor Author

closed as part of changing while loading to use error boundries (it also fixed in the deprecated while_loading code, but who cares)

@catmando catmando added the ready-to-release Internal Use Only: Has been fixed, specs passing and pushed to edge branch label Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-to-release Internal Use Only: Has been fixed, specs passing and pushed to edge branch
Projects
None yet
Development

No branches or pull requests

1 participant