As for spending time in a room with the person with the high fever and coughing, it sounds like they were probably past their peak viral shedding. This usually happens the day before symptom onset or the very first day of any COVID symptoms.
This is why COVID has been so difficult to contain, because by the time someone has had enough time to even notice symptoms and then go get tested, they've already shed most of the virus particles that they're going to. If they then have to wait a couple of days for a test result and don't isolate in the meantime, a positive test that late only makes a marginal difference in reducing transmission.