You quoted something about Group A Strep which isn't a virus, it's a bacterium.
Viruses can be swabbed for, but diagnoses can be made based on the clinical presentation and context - symptoms, known contacts, community prevalence, testing, other diagnostics, disease progression, clinical suspicion. E.g. if someone lives in a household with people who have covid symptoms, some of whom have tested positive, and that person has the same symptoms - even if they don't test or test negative, we would still suspect them of having covid. Could be something else but the likelihood is covid. E.g. on xray covid lungs look very different to flu/pneumonia lungs. Different diseases also respond differently to different treatments and can progress differently, which can also be an indicator. For example, initial syphilis and herpes infections can be pretty similar (flu-like illness, 1+ small lesions) but primary syphilis progresses to secondary syphilis, whereas herpes may become dormant or cause repeated outbreaks. At that stage they are much more distinguishable from each other. I think people often fail to understand that healthcare especially initially is to an extent best-guess guesswork that takes into accounts risks, benefits, and likelihoods.
People can also have multiple infections at once - including both viral and bacterial infections at the same time, or multiple viral infections. You could have flu and then develop a secondary bacterial chest infection with it, or be co-infected with flu and covid. Diagnosis and treatment decisions aren't always and solely dependant on test results, but can be informed by the whole clinical picture. And it's good they are not because tests especially microbiology diagnostics take time and you can't necessarily wait to treat.
Re GAS, because I think it's worth highlighting. You can carry GAS in the throat and on the skin without necessarily developing any of the numerous bacterial infections and post-infection complications it causes (strep throat/tonsillitis, impetigo, scarlet fever, rheumatic fever as a later complication if the scarlet fever isn't treated, and also the invasive infections (IGAS) that includes necrotizing fasciitis, streptococcal toxic shock syndrome). It can cause mild infections and very nasty, deadly infections. GAS can be cultured from swabs for e.g. if it's in the throat, but for scarlet fever doctors would normally go off the clinical picture to diagnose. If someone has an iGAS infection they will be unwell enough to be in hospital and blood cultures would be done but again, they wouldn't wait for the results back they would start treatment based on the clinical picture.
You cannot develop immunity to GAS and you cannot build up immunity to GAS by being exposed to GAS or other pathogens.