The problems you mention regarding your 2002 Nissan Altima's timing belt and fuel injector(s) may very well stop you from passing the smog check, due to high emissions. A sticking fuel injector may cause high or low CO emissions which in turn could cause either high NOx and/or high HC. Any one of these emissions, when above California's emission cutscores, will cause your Nissan Altima to fail the smog test.
The check engine light problem is an automatic failure when the light is on, or when the trouble codes are stored in the ECU (engine control unit). If the check engine light turned off after you replaced the oxygen sensor(s) this means you corrected the fault which was causing the check engine light to illuminate however your Nissan Altima still need to conduct one or two more internal self-tests prior to removing the trouble code from the ECU.