Not being in your school system, I don't know precisely by what you mean by "She did test for the advanced school and did not quite pass," but I'm going to assume here that your school system has some form of officially recognized "advanced academics" (as we call it here) or "gifted and talented" (as others systems call it) and that is what you mean by "advanced school."
If that is the case, have you truly investigated all the options for gettiing her into that program?
In our system, if a child does not test into the AAP (advanced academics program), the parents can appeal and can present teachers' letters, a parent recommendation form, and other evidence that the child should be in the more challenging AAP program despite test scores that are just below passing. Have you talked in detail to your school's "advanced school" liaison person, or to someone at the school district office, about whether there are options for parents to pursue if a a child falls just short in testing but the parents truly believe the child needs to be in this program? There may be options such as teacher referrals or principal referrals into the program for kids who clearly are academically advanced, and who need the challenge, but who perhaps do not test well on standardized tests like the ones used to determine entry into some programs. So be her advocate and get all the information as soon as you can, or you may miss deadlines for applying for an exception or submitting teacher letters, etc. The year is nearly over and any chance to appeal may be ending very soon.
It is very worrying when a bright child starts to hate school because she's bored. Have you had a face to face talk with her classroom teacher about this? (Without your child there, of course.) Does the school have any system for "pulling kids out" as it's called here for more in-depth work, when kids are identified as being capable of greater challenges? I would definitely tell the teacher your child is growing lazy and lackadaisical about school because she is bored and finds it too easy. Unfortunately, I suspect -- especially as it is very late in the school year and the teacher won't have time to work up something special for your child -- that the teacher will put it back on you and advise you to challenge her at home.
I would indeed do that; get her into summer "camps" or classes that are fun but educational (look up local science camps, math camps, writing camps for kids -- though usually writing camps are for kids older than yours). My daughter has been to a week-long writing workshop in the summer, a theatre workshop (great for kids who love reading and language) and "Mad Science" type camp with daily experiments that are fun.
But as for school -- if you cannot get her into the advanced program, and cannot look at other options like another school or private, you may have to get more involved and do things such as start a Math Counts or Science Olympiad or Lego Robotics program in her school next year, or volunteer to be the PTA person in charge of bringing in Mad Science for sessions of six or eight weeks of after-school fun classes (look it up online), or doing other things to stimulate her AND other kids who are lacking challenge. I hate to throw it onto you! The school should have more to serve kids like her who need challenges and who get left out when teachers must spend more time helping kids who are behind than working with kids who are ahead. But short of getting her into the advanced program, or moving schools, you may need to help the whole school by spearheading extracurricular challenges for these kids. (Last year my science-loving kid was soooo bored by science due to the teacher and the topics and it was participation in Science Olympiad that she said "saved my year.")
And in school next year -- be very clear and up-front with the teacher at the start that your child got bored and is on the cusp of disliking school if she does not get some form of better challenge in class!