[MM-40573] Stop asterisk detection on versions newer than 5.28, force space for the others (#1931)

* [MM-40573] Stop asking detection on versions newer than 5.29, force space for the others

* PR feedback and test fixes
This commit is contained in:
Devin Binnie
2021-12-23 16:49:53 -05:00
committed by GitHub
parent c28b219362
commit bd470459c2
2 changed files with 11 additions and 2 deletions

View File

@@ -310,7 +310,7 @@ describe('main/views/MattermostView', () => {
});
describe('updateMentionsFromTitle', () => {
const mattermostView = new MattermostView(tabView, {}, {}, {});
const mattermostView = new MattermostView(tabView, {remoteInfo: {serverVersion: '5.28.0'}}, {}, {});
it('should parse mentions from title', () => {
mattermostView.updateMentionsFromTitle('(7) Mattermost');
@@ -321,5 +321,10 @@ describe('main/views/MattermostView', () => {
mattermostView.updateMentionsFromTitle('* Mattermost');
expect(appState.updateMentions).toHaveBeenCalledWith(mattermostView.tab.name, 0, true);
});
it('should not parse unreads when title is on a channel with an asterisk before it', () => {
mattermostView.updateMentionsFromTitle('*testChannel - Mattermost');
expect(appState.updateMentions).toHaveBeenCalledWith(mattermostView.tab.name, 0, false);
});
});
});