There is a lot of misinformation on this thread. If you don't know the answer, or just want to get off-topic and argue, maybe you shouldn't be replying.
To answer OP's question: It really isn't clear if the Border Search Exception to the Fourth Amendment applies and, if so, to what degree. It is a legal gray area. Unfortunately, as far as I know, there is no concrete yes/no answer to your question. This is something that is likely headed to the SCOTUS in the near future. I do not know how they will rule on this, as the court has been fairly libertarian in recent years, but some of these Justices (especially the ones appointed by Trump) have some authoritarian (tyrannical) tendencies.
Someone posted earlier about the laws varying by state. State law is irrelevant, as CBP is a federal agency. State law would not curtail federal authority.
The 'Border Search Exception' has been a tool that has been routinely abused by border agents, usually as a means of discrimination and/or retaliation. There are plenty of horror stories out there. It is something that is in desperate need of reform by Congress or executive action. Too bad this Dementia-ridden puppet in office right now is unlikely to do anything useful for us. But hey, this is supposedly what 81 million USC's wanted. In 2018, there was a bi-partisan push to restrict CBP from searching electronics without cause, which was spear-headed by Senator Rand Paul, but unfortunately it failed.
I can relay my own experiences on this. A few years ago, my wife and I were pulled aside by two very irate Border Patrol agents while traveling south at a Port of Entry bridge into Mexico. The fact that Border Patrol agents were operating at a POE instead of their CBP counterparts should raise some eyebrows in-and-of itself. They were there to target us because I declined a vehicle search of my car by a local city police officer (NOT FEDERAL) during a traffic stop only minutes before, when I was pulled over for alleged speeding (something that was later thrown out in court). He radioed ahead to his BP buddies to stop us while walking into Mexico and give us some grief in retaliation. That cop was very angry at me for declining consent to rummage through my car.
The two agents searched every inch of us, for absolutely no reason. They then separated myself and my wife. One of them pointed and laughed at me out loud (obnoxiously loud) while I walked out as directed. After I left, the other one demanded to search my wife's phone. He went through all of her personal accounts, including e-mail, Instagram, Facebook, and her personal pictures. They found nothing of interest. He then grabbed my phone (which my wife was carrying), and demanded my password from her. She said no, because she did not know my password). This BP agent became enraged and banged my phone off of a desk. There was a gouge in the case because of this, but the phone itself was undamaged. They became increasing upset because they could not find anything criminal to charge us with. They tried taking her across the street to the CBP office (outside of my view and without me knowing), where CBP questioned her for two hours. After their additional two hours of questioning and finding absolutely nothing, they let her go and decided not to revoke her visitor visa. We were allowed to proceed to Mexico, and came back later that day without further incident.
I filed several complaints over the next few months. Last I heard, the two BP agents were "disciplined" (but they never divulged what they did). I've only seen one of those two around that POE in the years following this. Frankly, I think that man was high on drugs or steroids when this incident occurred, because he looked different the next time I saw him there (he lost of ton of muscle mass). This would explain his rage and irrational behavior. The city police officer who precipitated this was written up for the incident, and the traffic ticket was dismissed. I never saw the other BP agent again (the one that laughed at me). I would like to think that CBP fired him, but who knows. They will let these clowns get away with anything.
Here's the best solution to avoid any issue: either don't bring electronics, or (better yet) wipe your electronics before going to a POE or similar Constitution-free zone. In the mean time, write to your elected officials and advocate for an end to this routine fishing expedition.