|
360 | 360 | no_active_contact_element = supervisor_stats.find("span.no-attempted-contact") |
361 | 361 |
|
362 | 362 | expect(active_contact_element).to have_text(active_contacts_expected) |
363 | | - expect(active_contact_element.has_css?("pr-#{active_contacts_expected * 15}")) |
| 363 | + expect(active_contact_element).to match_css(".pr-#{active_contacts_expected * 15}") |
364 | 364 | expect(no_active_contact_element).to have_text(no_active_contacts_expected) |
365 | | - expect(no_active_contact_element.has_css?("pl-#{no_active_contacts_expected * 15}")) |
| 365 | + expect(no_active_contact_element).to match_css(".pl-#{no_active_contacts_expected * 15}") |
366 | 366 | expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected) |
367 | 367 | end |
368 | 368 |
|
|
378 | 378 | no_active_contact_element = supervisor_stats.find("span.no-attempted-contact") |
379 | 379 |
|
380 | 380 | expect(active_contact_element).to have_text(active_contacts_expected) |
381 | | - expect(active_contact_element.has_css?("pr-#{active_contacts_expected * 15}")) |
| 381 | + expect(active_contact_element).to match_css(".pr-#{active_contacts_expected * 15}") |
382 | 382 | expect(no_active_contact_element).to have_text(no_active_contacts_expected) |
383 | | - expect(no_active_contact_element.has_css?("pl-#{no_active_contacts_expected * 15}")) |
| 383 | + expect(no_active_contact_element).to match_css(".pl-#{no_active_contacts_expected * 15}") |
384 | 384 | expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected) |
385 | 385 | end |
386 | 386 |
|
|
393 | 393 | transition_aged_youth_expected = 3 |
394 | 394 | active_contact_element = supervisor_stats.find("span.attempted-contact") |
395 | 395 |
|
396 | | - expect { supervisor_stats.find("span.no-attempted-contact") }.to raise_error(Capybara::ElementNotFound) |
397 | 396 | expect(active_contact_element).to have_text(active_contacts_expected) |
398 | | - expect(active_contact_element.has_css?("pl-#{active_contacts_expected * 15}")) |
| 397 | + expect(active_contact_element).to match_css(".pl-#{active_contacts_expected * 15}") |
399 | 398 | expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected) |
| 399 | + expect(supervisor_stats).not_to have_css("span.no-attempted-contact") |
400 | 400 | end |
401 | 401 |
|
402 | 402 | it "shows the correct element for a supervisor with only no contact volunteers", :js do |
|
408 | 408 | transition_aged_youth_expected = 2 |
409 | 409 | no_contact_element = supervisor_stats.find("span.no-attempted-contact") |
410 | 410 |
|
411 | | - expect { supervisor_stats.find("span.attempted-contact") }.to raise_error(Capybara::ElementNotFound) |
412 | | - expect { supervisor_stats.find("span.attmepted-contact-end") }.to raise_error(Capybara::ElementNotFound) |
413 | 411 | expect(no_contact_element).to have_text(no_contacts_expected) |
414 | | - expect(no_contact_element.has_css?("pl-#{no_contacts_expected * 15}")) |
| 412 | + expect(no_contact_element).to match_css(".pl-#{no_contacts_expected * 15}") |
415 | 413 | expect(supervisor_stats.find(".status-btn.deactive-bg")).to have_text(transition_aged_youth_expected) |
| 414 | + expect(supervisor_stats).not_to have_css("span.attempted-contact") |
| 415 | + expect(supervisor_stats).not_to have_css("span.attempted-contact-end") |
416 | 416 | end |
417 | 417 |
|
418 | 418 | it "shows the correct text with a supervisor with no assigned volunteers", :js do |
|
422 | 422 | supervisor_no_volunteer_stats = page.find("tr#supervisor-#{no_active_volunteers_supervisor.id}-information") |
423 | 423 | expect(supervisor_no_volunteer_stats).to have_text("No assigned volunteers") |
424 | 424 | expect(supervisor_no_volunteer_stats.find("span.no-volunteers")).to be_truthy |
425 | | - expect(supervisor_no_volunteer_stats.find("span.no-volunteers").style("flex-grow")).to eq({"flex-grow" => "1"}) |
| 425 | + expect(supervisor_no_volunteer_stats.find("span.no-volunteers").style("flex-grow")).to eq({ "flex-grow" => "1" }) |
426 | 426 | end |
427 | 427 | end |
428 | 428 | end |
0 commit comments