1. Remove the sunroof switch.
2. Inspect for continuity between the sunroof switch terminals using an ohmmeter.


Sunroof switch removal/installationMazda 6 Service Manual: Scheduled Maintenance (U.S.A., Canada, and Puerto Rico)
Follow Schedule 1 if the vehicle is operated mainly where none of the following
conditions (severe driving conditions) apply.
Repeated short-distance driving
Driving in dusty conditions
Driving with extended use of brakes
Driving in areas where salt or other corrosive materials are used
...
Mazda 6 Service Manual: Front door removal/installation
1. Disconnect the negative battery cable.
2. To remove the front door hinge, remove the front fender panel.
3. To remove the checker, remove the door speaker.
4. Remove in the order indicated in the table.
5. Install in the reverse order of removal.
6. Adjust the front door. (See DOOR ADJUS ...