Skip to content

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

Closed
@catmando

Description

@catmando
# 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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-to-releaseInternal Use Only: Has been fixed, specs passing and pushed to edge branch

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions