People wait in line for nucleic acid tests to detect COVID-19 at a testing site on June 9, 2022, in Beijing, China. China says it has generally controlled recent outbreaks in Beijing after hundreds of people tested positive for the virus in recent weeks.Kevin Frayer | Getty Images News | Getty ImagesBEIJING — China’s two largest cities are tightening some Covid measures again, just days after loosening them as the virus appeared under control.Shanghai, which emerged from a two-month lockdown early this month, said Thursday that seven of its 16 districts would conduct mass testing this weekend, according to state media. Those areas included financial and downtown districts.During the testing period, residents in affected areas will need to stay home until the testing is over, the city said in the comments section of an official release.It was not clear to what extent other restrictions on business would be applied during the testing. Implementation of Covid restrictions can also vary by apartment neighborhood. Factories can generally remain in operation if their workers live on-site or otherwise operate in a bubble.Minhang, one of the seven districts and located near the outskirts of Shanghai, told residents Thursday to stay home during virus testing on Saturday.Since Thursday, at least three districts in Beijing have ordered bars and some other entertainment venues to close until further notice. After the city reported one new confirmed Covid case for Wednesday, a handful of subsequent cases were tied to bars and nightclubs.Beijing allowed restaurants on Monday to resume serving customers inside stores, after only permitting takeout or delivery for about a month. The latest outbreak in the capital city began in late April.Read more about China from CNBC ProMainland China reported 30 new confirmed Covid cases for Thursday, including 15 in Inner Mongolia, where a small city locked down last week after a few new Covid cases.Universal Beijing Resort said earlier this week it planned to reopen on June 15 after closing temporarily in early May.Shanghai Disneyland and Disneytown have been closed since late March. Some Shanghai Disney Resort retail and park areas reopened Friday.Disclosure: NBCUniversal is the parent company of Universal Studios and CNBC.