The vote followed days of chaos in the Republican-controlled House, which served as a precursor of things to come next year.