From 5bff6f9e58859d35dca5d4d733857677d4950aa1 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Tue, 6 Apr 2021 10:28:38 -0400 Subject: [PATCH] MM-31874 Properly use theme mention highlight color (#5268) --- .../__snapshots__/at_mention.test.js.snap | 24 +++++++++++++++---- app/components/at_mention/at_mention.js | 13 +++++----- app/components/at_mention/at_mention.test.js | 5 +++- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/app/components/at_mention/__snapshots__/at_mention.test.js.snap b/app/components/at_mention/__snapshots__/at_mention.test.js.snap index ae4e354a1..6427acd72 100644 --- a/app/components/at_mention/__snapshots__/at_mention.test.js.snap +++ b/app/components/at_mention/__snapshots__/at_mention.test.js.snap @@ -2,13 +2,18 @@ exports[`AtMention should match snapshot, no highlight 1`] = ` {suffix} @@ -207,7 +206,7 @@ export default class AtMention extends React.PureComponent { } if (highlighted) { - mentionTextStyle.push({backgroundColor}); + mentionTextStyle.push({backgroundColor, color: theme.mentionColor}); } return ( diff --git a/app/components/at_mention/at_mention.test.js b/app/components/at_mention/at_mention.test.js index e0de559cc..c996b1aeb 100644 --- a/app/components/at_mention/at_mention.test.js +++ b/app/components/at_mention/at_mention.test.js @@ -3,6 +3,9 @@ import React from 'react'; import {shallow} from 'enzyme'; + +import {Preferences} from '@mm-redux/constants'; + import AtMention from './at_mention.js'; describe('AtMention', () => { @@ -13,7 +16,7 @@ describe('AtMention', () => { mentionName: 'John.Smith', mentionStyle: {color: '#ff0000'}, textStyle: {backgroundColor: 'yellow'}, - theme: {}, + theme: Preferences.THEMES.default, }; test('should match snapshot, no highlight', () => {