The deputy leader of Welsh Labour was warned about making comments regarding a colleague's sexuality by a former MP, a court has heard.
Cardiff Crown Court was told Swansea East MP Carolyn Harris would "comment and joke" about aide Jenny Lee Clarke's sexuality when they worked together.
She was spoken to for her behaviour by Sian James, the court heard.
Ms Clarke, 42, of Penllergaer, Swansea, is accused of increasing her wages by £2,000 but denies fraud and forgery.
Mrs Harris, 57, was warned about her behaviour by her predecessor as Swansea East MP Mrs James, the court heard.
A jury was told Mrs Harris pulled Ms Clarke's hair when the two women worked together at the constituency office before Mrs Harris became an MP.
Mrs Harris also called Ms Clarke, who was Mrs Harris' office manager, a "dyke" and frequently made comments about her choice of clothes and hairstyles, the court heard.
Mrs Harris later defended the comments as "office banter" - but the jury was told she was warned she could face disciplinary action if more complaints were made.
Mrs James, who stood down as Swansea East MP in 2015, told the court how Ms Clarke came to her with concerns about how Mrs Harris treated her during work hours.
"It was to do with Clarke's sexuality," said Mrs James, adding: "She was starting to feel these comments had gone beyond banter and were causing her concern."
Mrs James said she had taken an "informal route" of speaking to Mrs Harris and Ms Clarke about what was expected in an office environment.
She warned if the issue was raised again she would take "disciplinary action".
Giving evidence, Mrs Harris told the court she was "no homophobe".
Mrs James said concerns were again raised about Mrs Harris' behaviour after she replaced her as MP in the 2015 General Election.
Ms Clarke is accused of forging Mrs Harris' signature after she was elected, to give herself a £2,000-a-year pay rise and lower her working hours.
Ms Clarke acknowledged she had signed a document that amended the form, but said Mrs Harris had "given me her authorisation".
The trial continues.