Your history is apparently no better.
The US was certainly in North Africa. The 2nd Corps commanded by Major General Lloyd Fredendall was in Tunisia and was a major element in the Battle of Kasserine Pass. They performed rather poorly, Rommel saying that they made many mistakes typical of inexperienced soldiers and leaders (but also stated that he was unable to really take advantage of this because of lack of support and what amounted to overly specific orders from above from those who failed to understand what he wanted to accomplish in that particular battle - specifically, he wanted to seize the American supplies but the Italian High Command changed the plan to something completely different which denied him the chance to take the supply depot). Ultimately, the dug in US troops which had been forced to withdraw with heavy casualties earlier, and some US reinforcements (including a bunch of artillery that had been ordered to go elsewhere by the British commander, but that order was countermanded by another American general) with a lot of British support (including some artillery and a bunch of infantry, the majority of the infantry in the front lines) managed to halt Rommels advance, pinning his forces down largely due to the mass of artillery fire which was intense enough that he could not even pull back until nightfall.
The dismal performance of the US 2nd Corps in that battle is what lead to Major General Fredendall being replaced by Major General Patton. Several other officers were reassigned as well. It also lead to many changed in US tactics and doctrine, including freeing up the commanders at the location to do more without asking permission from higher up (Patton became well know for ignoring orders, mostly those that were based on situations that no longer existed).
Patton was also already in North Africa at that time. This engagement of US forces with Rommel's forces was in Februrary of 1943. Patton had arrived in Morocco on November 8, 1942, commanding the Western Task Force. They captured Cassablanca from the Vichy French in 3 days and Patton negotiated an armistice withe the French commander. He took command of the 2nd Corps on March 6, 1943 and instituted many changes. On March 17th some of those US forces took Gafsa. By that time Rommel was already back in Germany.
So the US forces under Patton never fought the Axis forces under Rommel (just under the Italian General who replaced him), although the corps he was put in command of had fought Rommel once.
But yes, the US millitary and Patton were in North Africa before the final defeat of "Rommels forces". But other than that one battle he was not really in command of them by the time the US forces fought them - the Italians took over the force since by that time it consisted of 3 Italian corps and only 1 German corp, the actual appointment of the Italian general was a couple of weeks before this battle but Rommel lead a major force in the battle. Then less than a month later Rommel went back to Germany to try to explain things to Hitler, who never understood what he was trying to tell him, and Rommel never went back to Africa. Two months later, in May, that Axis force in North Africa was finally defeated (by that time it was certainly not Rommel being defeated as he was not in command of it and had not been there at all for a couple of months).