Chore: organize test files and fix code coverage (#24900)
Co-authored-by: montini.ext tiago <tiago.montini.ext@sodexo.com> Co-authored-by: Rodrigo Nascimento <rodrigoknascimento@gmail.com> Co-authored-by: Weslley de Campos <weslley.campos.ext@sodexo.com> Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com>pull/25081/head
parent
c43d1c64fc
commit
ca5fcdd464
@ -1,8 +1,12 @@ |
||||
/* eslint-disable @typescript-eslint/camelcase */ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { UserStatus } from '../../../../../definition/UserStatus'; |
||||
import { processConnectionStatus, processStatus, processPresenceAndStatus } from './processConnectionStatus'; |
||||
import { UserStatus } from '../../../../../../../definition/UserStatus'; |
||||
import { |
||||
processConnectionStatus, |
||||
processStatus, |
||||
processPresenceAndStatus, |
||||
} from '../../../../../../server/services/presence/lib/processConnectionStatus'; |
||||
|
||||
describe('Presence micro service', () => { |
||||
it('should return connection as online when there is a connection online', () => { |
||||
@ -1,6 +1,12 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { normalizers, fromTemplate, renameInvalidProperties, getNestedValue, getRegexpMatch } from './transform_helpers'; |
||||
import { |
||||
normalizers, |
||||
fromTemplate, |
||||
renameInvalidProperties, |
||||
getNestedValue, |
||||
getRegexpMatch, |
||||
} from '../../../../../app/custom-oauth/server/transform_helpers'; |
||||
|
||||
const data = { |
||||
'id': '123456', |
||||
@ -1,6 +1,6 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { highlightWords, getRegexHighlight, getRegexHighlightUrl } from '../client/helper'; |
||||
import { highlightWords, getRegexHighlight, getRegexHighlightUrl } from '../../../../app/highlight-words/client/helper'; |
||||
|
||||
describe('helper', () => { |
||||
describe('highlightWords', () => { |
||||
@ -1,7 +1,7 @@ |
||||
import { expect } from 'chai'; |
||||
import './server.mocks.js'; |
||||
|
||||
import PasswordPolicyClass from '../server/lib/PasswordPolicyClass'; |
||||
import PasswordPolicyClass from '../../../../app/lib/server/lib/PasswordPolicyClass'; |
||||
|
||||
describe('PasswordPolicyClass', () => { |
||||
describe('Default options', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { replaceVariables } from '../server/replaceVariables'; |
||||
import { replaceVariables } from '../../../../app/mailer/server/replaceVariables'; |
||||
|
||||
describe('Mailer-API', function () { |
||||
describe('replaceVariables', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { MentionsParser } from '../lib/MentionsParser'; |
||||
import { MentionsParser } from '../../../../app/mentions/lib/MentionsParser'; |
||||
|
||||
let mentionsParser; |
||||
beforeEach(() => { |
||||
@ -1,6 +1,6 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import MentionsServer from '../server/Mentions'; |
||||
import MentionsServer from '../../../../app/mentions/server/Mentions'; |
||||
|
||||
let mention; |
||||
|
||||
@ -1,14 +1,14 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import '../../lib/tests/server.mocks.js'; |
||||
import { AuthorizeRequest } from '../server/lib/generators/AuthorizeRequest'; |
||||
import { LogoutRequest } from '../server/lib/generators/LogoutRequest'; |
||||
import { LogoutResponse } from '../server/lib/generators/LogoutResponse'; |
||||
import { ServiceProviderMetadata } from '../server/lib/generators/ServiceProviderMetadata'; |
||||
import { LogoutRequestParser } from '../server/lib/parsers/LogoutRequest'; |
||||
import { LogoutResponseParser } from '../server/lib/parsers/LogoutResponse'; |
||||
import { ResponseParser } from '../server/lib/parsers/Response'; |
||||
import { SAMLUtils } from '../server/lib/Utils'; |
||||
import '../lib/server.mocks'; |
||||
import { AuthorizeRequest } from '../../../../app/meteor-accounts-saml/server/lib/generators/AuthorizeRequest'; |
||||
import { LogoutRequest } from '../../../../app/meteor-accounts-saml/server/lib/generators/LogoutRequest'; |
||||
import { LogoutResponse } from '../../../../app/meteor-accounts-saml/server/lib/generators/LogoutResponse'; |
||||
import { ServiceProviderMetadata } from '../../../../app/meteor-accounts-saml/server/lib/generators/ServiceProviderMetadata'; |
||||
import { LogoutRequestParser } from '../../../../app/meteor-accounts-saml/server/lib/parsers/LogoutRequest'; |
||||
import { LogoutResponseParser } from '../../../../app/meteor-accounts-saml/server/lib/parsers/LogoutResponse'; |
||||
import { ResponseParser } from '../../../../app/meteor-accounts-saml/server/lib/parsers/Response'; |
||||
import { SAMLUtils } from '../../../../app/meteor-accounts-saml/server/lib/Utils'; |
||||
import { |
||||
serviceProviderOptions, |
||||
simpleMetadata, |
||||
@ -1,6 +1,6 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { getSettingDefaults } from './getSettingDefaults'; |
||||
import { getSettingDefaults } from '../../../../../../app/settings/server/functions/getSettingDefaults'; |
||||
|
||||
describe('getSettingDefaults', () => { |
||||
it('should return based on _id type value', () => { |
||||
@ -1,7 +1,7 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { getSettingDefaults } from './getSettingDefaults'; |
||||
import { overrideGenerator } from './overrideGenerator'; |
||||
import { getSettingDefaults } from '../../../../../../app/settings/server/functions/getSettingDefaults'; |
||||
import { overrideGenerator } from '../../../../../../app/settings/server/functions/overrideGenerator'; |
||||
|
||||
describe('overrideGenerator', () => { |
||||
it('should return a new object with the new value', () => { |
||||
@ -1,9 +1,9 @@ |
||||
/* eslint-disable @typescript-eslint/camelcase */ |
||||
import { expect, spy } from 'chai'; |
||||
|
||||
import { Settings } from './settings.mocks'; |
||||
import { SettingsRegistry } from '../SettingsRegistry'; |
||||
import { CachedSettings } from '../CachedSettings'; |
||||
import { Settings } from '../../../../../../app/settings/server/functions/settings.mocks'; |
||||
import { SettingsRegistry } from '../../../../../../app/settings/server/SettingsRegistry'; |
||||
import { CachedSettings } from '../../../../../../app/settings/server/CachedSettings'; |
||||
|
||||
describe('Settings', () => { |
||||
beforeEach(() => { |
||||
@ -1,7 +1,7 @@ |
||||
/* eslint-disable @typescript-eslint/camelcase */ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { validateSetting } from './validateSetting'; |
||||
import { validateSetting } from '../../../../../../app/settings/server/functions/validateSetting'; |
||||
|
||||
describe('validateSettings', () => { |
||||
it('should validate the type string', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { UAParserMobile, UAParserDesktop } from './UAParserCustom'; |
||||
import { UAParserMobile, UAParserDesktop } from '../../../../../../app/statistics/server/lib/UAParserCustom'; |
||||
|
||||
const UAMobile = 'RC Mobile; iOS 12.2; v3.4.0 (250)'; |
||||
const UADesktop = |
||||
@ -1,7 +1,7 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import './server.mocks.js'; |
||||
import { messageProperties } from '../lib/MessageProperties'; |
||||
import { messageProperties } from '../../../../app/ui-utils/lib/MessageProperties'; |
||||
|
||||
const messages = { |
||||
'Sample Message': 14, |
||||
@ -1,6 +1,6 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { timeAgo } from '../helpers'; |
||||
import { timeAgo } from '../../../../../../../app/ui/client/views/app/helpers'; |
||||
|
||||
describe('Helpers', () => { |
||||
describe('timeAgo', () => { |
||||
@ -1,7 +1,7 @@ |
||||
import { expect } from 'chai'; |
||||
import s from 'underscore.string'; |
||||
|
||||
import { _getURL } from './getURL'; |
||||
import { _getURL } from '../../../../../app/utils/lib/getURL'; |
||||
|
||||
const testPaths = (o, _processPath) => { |
||||
let processPath = _processPath; |
||||
@ -1,7 +1,7 @@ |
||||
import { expect, spy } from 'chai'; |
||||
import { describe, it } from 'mocha'; |
||||
|
||||
import { download, downloadAs, downloadCsvAs, downloadJsonAs } from './download'; |
||||
import { download, downloadAs, downloadCsvAs, downloadJsonAs } from '../../../../client/lib/download'; |
||||
|
||||
describe('download', () => { |
||||
it('should work', () => { |
||||
@ -1,8 +1,8 @@ |
||||
import { expect } from 'chai'; |
||||
import { describe, it } from 'mocha'; |
||||
|
||||
import { getBSONType, compareBSONValues } from './bson'; |
||||
import { BSONType } from './types'; |
||||
import { getBSONType, compareBSONValues } from '../../../../../client/lib/minimongo/bson'; |
||||
import { BSONType } from '../../../../../client/lib/minimongo/types'; |
||||
|
||||
describe('getBSONType', () => { |
||||
it('should work', () => { |
||||
@ -1,7 +1,7 @@ |
||||
import { expect } from 'chai'; |
||||
import { describe, it } from 'mocha'; |
||||
|
||||
import { equals, isObject, flatSome, some, isEmptyArray } from './comparisons'; |
||||
import { equals, isObject, flatSome, some, isEmptyArray } from '../../../../../client/lib/minimongo/comparisons'; |
||||
|
||||
describe('Comparisons service', () => { |
||||
describe('equals', () => { |
||||
@ -1,7 +1,7 @@ |
||||
import { expect } from 'chai'; |
||||
import { describe, it } from 'mocha'; |
||||
|
||||
import { createLookupFunction } from './lookups'; |
||||
import { createLookupFunction } from '../../../../../client/lib/minimongo/lookups'; |
||||
|
||||
describe('createLookupFunction', () => { |
||||
it('should work', () => { |
||||
@ -1,6 +1,9 @@ |
||||
import { assert } from 'chai'; |
||||
|
||||
import { parseStringToIceServers, parseStringToIceServer } from './parseStringToIceServers'; |
||||
import { |
||||
parseStringToIceServers, |
||||
parseStringToIceServer, |
||||
} from '../../../../../../client/providers/CallProvider/lib/parseStringToIceServers'; |
||||
|
||||
describe('parseStringToIceServers', () => { |
||||
describe('parseStringToIceServers', () => { |
||||
@ -1,8 +1,8 @@ |
||||
/* eslint-env mocha */ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { App } from '../types'; |
||||
import { filterAppsByCategories } from './filterAppsByCategories'; |
||||
import { App } from '../../../../../../../client/views/admin/apps/types'; |
||||
import { filterAppsByCategories } from '../../../../../../../client/views/admin/apps/helpers/filterAppsByCategories'; |
||||
|
||||
describe('filterAppsByCategories', () => { |
||||
it('should return true if the app is in the categories', () => { |
||||
@ -1,8 +1,8 @@ |
||||
/* eslint-env mocha */ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { App } from '../types'; |
||||
import { filterAppsByCategory } from './filterAppsByCategory'; |
||||
import { App } from '../../../../../../../client/views/admin/apps/types'; |
||||
import { filterAppsByCategory } from '../../../../../../../client/views/admin/apps/helpers/filterAppsByCategory'; |
||||
|
||||
describe('filterAppsByCategory', () => { |
||||
it('should return true if the app is in the category', () => { |
||||
@ -1,7 +1,7 @@ |
||||
/* eslint-env mocha */ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { filterAppsByFree } from './filterAppsByFree'; |
||||
import { filterAppsByFree } from '../../../../../../../client/views/admin/apps/helpers/filterAppsByFree'; |
||||
|
||||
describe('filterAppsByFree', () => { |
||||
it('should return true if app purchase type is buy and price does not exist or is 0', () => { |
||||
@ -1,7 +1,7 @@ |
||||
/* eslint-env mocha */ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { filterAppsByPaid } from './filterAppsByPaid'; |
||||
import { filterAppsByPaid } from '../../../../../../../client/views/admin/apps/helpers/filterAppsByPaid'; |
||||
|
||||
describe('filterAppsByPaid', () => { |
||||
it('should return true if both app purchase type is subscription and app price exists and is not 0', () => { |
||||
@ -1,7 +1,7 @@ |
||||
/* eslint-env mocha */ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { filterAppsByText } from './filterAppsByText'; |
||||
import { filterAppsByText } from '../../../../../../../client/views/admin/apps/helpers/filterAppsByText'; |
||||
|
||||
describe('filterAppsByText', () => { |
||||
it('should return true if the text is the name of an app', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { assert } from 'chai'; |
||||
|
||||
import { isTeamsAddMembersProps } from './TeamsAddMembersProps'; |
||||
import { isTeamsAddMembersProps } from '../../../../../../definition/rest/v1/teams/TeamsAddMembersProps'; |
||||
|
||||
describe('TeamsAddMemberProps (definition/rest/v1)', () => { |
||||
describe('isTeamsAddMembersProps', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { assert } from 'chai'; |
||||
|
||||
import { isTeamsConvertToChannelProps } from './TeamsConvertToChannelProps'; |
||||
import { isTeamsConvertToChannelProps } from '../../../../../../definition/rest/v1/teams/TeamsConvertToChannelProps'; |
||||
|
||||
describe('TeamsConvertToChannelProps (definition/rest/v1)', () => { |
||||
describe('isTeamsConvertToChannelProps', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { assert } from 'chai'; |
||||
|
||||
import { isTeamsDeleteProps } from './TeamsDeleteProps'; |
||||
import { isTeamsDeleteProps } from '../../../../../../definition/rest/v1/teams/TeamsDeleteProps'; |
||||
|
||||
describe('TeamsDeleteProps (definition/rest/v1)', () => { |
||||
describe('isTeamsDeleteProps', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { assert } from 'chai'; |
||||
|
||||
import { isTeamsLeaveProps } from './TeamsLeaveProps'; |
||||
import { isTeamsLeaveProps } from '../../../../../../definition/rest/v1/teams/TeamsLeaveProps'; |
||||
|
||||
describe('TeamsLeaveProps (definition/rest/v1)', () => { |
||||
describe('isTeamsLeaveProps', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { assert } from 'chai'; |
||||
|
||||
import { isTeamsRemoveMemberProps } from './TeamsRemoveMemberProps'; |
||||
import { isTeamsRemoveMemberProps } from '../../../../../../definition/rest/v1/teams/TeamsRemoveMemberProps'; |
||||
|
||||
describe('Teams (definition/rest/v1)', () => { |
||||
describe('isTeamsRemoveMemberProps', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { assert } from 'chai'; |
||||
|
||||
import { isTeamsRemoveRoomProps } from './TeamsRemoveRoomProps'; |
||||
import { isTeamsRemoveRoomProps } from '../../../../../../definition/rest/v1/teams/TeamsRemoveRoomProps'; |
||||
|
||||
describe('TeamsRemoveRoomProps (definition/rest/v1)', () => { |
||||
describe('isTeamsRemoveRoomProps', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { assert } from 'chai'; |
||||
|
||||
import { isTeamsUpdateMemberProps } from './TeamsUpdateMemberProps'; |
||||
import { isTeamsUpdateMemberProps } from '../../../../../../definition/rest/v1/teams/TeamsUpdateMemberProps'; |
||||
|
||||
describe('TeamsUpdateMemberProps (definition/rest/v1)', () => { |
||||
describe('isTeamsUpdateMemberProps', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { assert } from 'chai'; |
||||
|
||||
import { isTeamsUpdateProps } from './TeamsUpdateProps'; |
||||
import { isTeamsUpdateProps } from '../../../../../../definition/rest/v1/teams/TeamsUpdateProps'; |
||||
|
||||
describe('TeamsUpdateMemberProps (definition/rest/v1)', () => { |
||||
describe('isTeamsUpdateProps', () => { |
||||
@ -1,7 +1,7 @@ |
||||
import { expect } from 'chai'; |
||||
import { describe, it } from 'mocha'; |
||||
|
||||
import { getUpgradeTabType } from './getUpgradeTabType'; |
||||
import { getUpgradeTabType } from '../../../lib/getUpgradeTabType'; |
||||
|
||||
describe('getUpgradeTabType()', () => { |
||||
it("should return 'goFullyFeatured'", () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { getMostImportantRole } from './getMostImportantRole'; |
||||
import { getMostImportantRole } from '../../../../lib/roles/getMostImportantRole'; |
||||
|
||||
describe('getMostImportantRole', () => { |
||||
it('should return the same role if only one exists', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { ensureArray } from './arrayUtils'; |
||||
import { ensureArray } from '../../../../lib/utils/arrayUtils'; |
||||
|
||||
describe('Array utils', () => { |
||||
it('should return an array with one item', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { parseCSV } from './parseCSV'; |
||||
import { parseCSV } from '../../../../lib/utils/parseCSV'; |
||||
|
||||
describe('Parse CSV', () => { |
||||
it('should return an empty array for an empty string', () => { |
||||
@ -1,6 +1,6 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { fileName, joinPath } from './fileUtils'; |
||||
import { fileName, joinPath } from '../../../../server/lib/fileUtils'; |
||||
|
||||
describe('File utils', () => { |
||||
it('should return a valid file name', () => { |
||||
Loading…
Reference in new issue