@zohodesk/testinglibrary 0.4.6-experimental → 0.4.7-experimental

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitlab-ci.yml CHANGED
@@ -1,4 +1,4 @@
1
- image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v2
1
+ image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v3
2
2
 
3
3
  #workflow:
4
4
  # rules:
@@ -12,7 +12,7 @@ stages:
12
12
  # Install dependencies stage
13
13
  build:
14
14
  stage: build
15
- image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v2
15
+ image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v3
16
16
  script:
17
17
  - npm install
18
18
  artifacts:
@@ -23,7 +23,7 @@ build:
23
23
  # Unit tests stage
24
24
  unit:
25
25
  stage: unit
26
- image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v2
26
+ image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v3
27
27
  script:
28
28
  - npm run test
29
29
  artifacts:
@@ -34,7 +34,7 @@ unit:
34
34
  # UAT tests stage
35
35
  uat-auth:
36
36
  stage: uat
37
- image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v2
37
+ image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v3
38
38
  script:
39
39
  - npm install
40
40
  - npm run build
@@ -53,7 +53,7 @@ uat-auth:
53
53
 
54
54
  uat-noauth:
55
55
  stage: uat
56
- image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v2
56
+ image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v3
57
57
  script:
58
58
  - npm install
59
59
  - npm run build
@@ -72,7 +72,7 @@ uat-noauth:
72
72
 
73
73
  uat-profile:
74
74
  stage: uat
75
- image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v2
75
+ image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v3
76
76
  script:
77
77
  - npm install
78
78
  - npm run build
@@ -91,7 +91,7 @@ uat-profile:
91
91
 
92
92
  uat-nobdd:
93
93
  stage: uat
94
- image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v2
94
+ image: repository.desk.csez.zohocorpin.com/base-image/testing-framework-gitlab-runne-base:v3
95
95
  script:
96
96
  - npm install
97
97
  - npm run build
package/README.md CHANGED
@@ -49,7 +49,13 @@
49
49
  - @playwright/test - 1.48.0,
50
50
  - @cucumber/cucumber - 11.0.1
51
51
  - From this version, We adopt the playwright-bdd as library instead of modified source
52
-
52
+ - Published on 11-11-2024
53
+
53
54
  #### Deprecations
54
55
  - **Deprecated**: Passing `video` and `trace` as boolean (`true`/`false`) in project configuration.
55
- - **New Approach**: Use Playwright values for `video` and `trace` options, such as `'on'`, `'retain-on-failure'`, or `'off'`.
56
+ - **New Approach**: Use Playwright values for `video` and `trace` options, such as `'on'`, `'retain-on-failure'`, or `'off'`.
57
+
58
+ ### v0.3.1 - 13-11-2024
59
+
60
+ #### Issue Fix
61
+ - Adding bddmode to get the fixtures.
@@ -10,7 +10,7 @@ const {
10
10
  bddMode
11
11
  } = (0, _readConfigFile.generateConfigFromFile)();
12
12
  let base = bddMode ? _playwrightBdd.test : _test.test;
13
- const buildInFixtures = (0, _builtInFixtures.default)();
13
+ const buildInFixtures = (0, _builtInFixtures.default)(bddMode);
14
14
  const buildInFixturesTest = base.extend({
15
15
  ...buildInFixtures
16
16
  });
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ var _logger = require("../../utils/logger");
4
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
5
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
6
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
7
+ var _buildTagsString = /*#__PURE__*/new WeakSet();
8
+ var _parseEdition = /*#__PURE__*/new WeakSet();
9
+ var _processSingleEdition = /*#__PURE__*/new WeakSet();
10
+ var _processMultipleEditions = /*#__PURE__*/new WeakSet();
11
+ var _getEditionArgs = /*#__PURE__*/new WeakSet();
12
+ var _buildEditionTags = /*#__PURE__*/new WeakSet();
13
+ class TagProcessor {
14
+ constructor(editionOrder) {
15
+ _classPrivateMethodInitSpec(this, _buildEditionTags);
16
+ _classPrivateMethodInitSpec(this, _getEditionArgs);
17
+ _classPrivateMethodInitSpec(this, _processMultipleEditions);
18
+ _classPrivateMethodInitSpec(this, _processSingleEdition);
19
+ _classPrivateMethodInitSpec(this, _parseEdition);
20
+ _classPrivateMethodInitSpec(this, _buildTagsString);
21
+ this.editionOrder = editionOrder;
22
+ }
23
+ processTags(userArgs) {
24
+ const tagArgs = userArgs['tags'] || '';
25
+ const edition = userArgs['edition'] || null;
26
+ if (!edition) return tagArgs;
27
+ const editionsArray = edition.split(',');
28
+ const editionTags = editionsArray.length === 1 ? _classPrivateMethodGet(this, _processSingleEdition, _processSingleEdition2).call(this, editionsArray[0], tagArgs) : _classPrivateMethodGet(this, _processMultipleEditions, _processMultipleEditions2).call(this, editionsArray, tagArgs);
29
+ return editionTags;
30
+ }
31
+ }
32
+ function _buildTagsString2(tags, editionTags) {
33
+ return tags && tags !== '' ? `${tags} and not (${editionTags})` : `not (${editionTags})`;
34
+ }
35
+ function _parseEdition2(edition) {
36
+ if (edition.startsWith('<=')) return ['<=', edition.slice(2)];
37
+ if (edition.startsWith('>=')) return ['>=', edition.slice(2)];
38
+ if (edition.startsWith('<')) return ['<', edition.slice(1)];
39
+ if (edition.startsWith('>')) return ['>', edition.slice(1)];
40
+ return [null, edition];
41
+ }
42
+ function _processSingleEdition2(selectedEdition, tagArgs) {
43
+ const editionArgs = _classPrivateMethodGet(this, _getEditionArgs, _getEditionArgs2).call(this, selectedEdition);
44
+ if (editionArgs && editionArgs.length > 0) {
45
+ const editionTags = _classPrivateMethodGet(this, _buildEditionTags, _buildEditionTags2).call(this, editionArgs, 'or');
46
+ return _classPrivateMethodGet(this, _buildTagsString, _buildTagsString2).call(this, tagArgs, editionTags);
47
+ }
48
+ _logger.Logger.log(_logger.Logger.INFO_TYPE, `No matching editions for ${selectedEdition} found. Running with default edition`);
49
+ return tagArgs;
50
+ }
51
+ function _processMultipleEditions2(editionsArray, tagArgs) {
52
+ const filteredEditions = this.editionOrder.filter(edition => !editionsArray.includes(edition));
53
+ const editionTags = _classPrivateMethodGet(this, _buildEditionTags, _buildEditionTags2).call(this, filteredEditions, 'or');
54
+ return _classPrivateMethodGet(this, _buildTagsString, _buildTagsString2).call(this, tagArgs, editionTags);
55
+ }
56
+ function _getEditionArgs2(selectedEdition) {
57
+ const [operator, editionValue] = _classPrivateMethodGet(this, _parseEdition, _parseEdition2).call(this, selectedEdition.toLowerCase());
58
+ const index = this.editionOrder.findIndex(edition => edition.toLowerCase() === editionValue);
59
+ if (index === -1) {
60
+ _logger.Logger.log(_logger.Logger.INFO_TYPE, `No matching editions for ${selectedEdition} found. Running with default edition`);
61
+ return [];
62
+ }
63
+ switch (operator) {
64
+ case '<=':
65
+ return this.editionOrder.slice(index + 1);
66
+ case '>=':
67
+ return this.editionOrder.slice(0, index);
68
+ case '<':
69
+ return this.editionOrder.slice(index);
70
+ case '>':
71
+ return this.editionOrder.slice(0, index + 1);
72
+ default:
73
+ return this.editionOrder.filter((_, i) => i !== index);
74
+ }
75
+ }
76
+ function _buildEditionTags2(editionArgs, operator = 'or') {
77
+ return editionArgs.map(edition => `@edition_${edition}`).join(` ${operator} `);
78
+ }
79
+ module.exports = TagProcessor;
@@ -14,7 +14,7 @@ var _envInitializer = require("./env-initializer");
14
14
  var _logger = require("../../utils/logger");
15
15
  var _readConfigFile = require("./readConfigFile");
16
16
  var _rootPath = require("../../utils/rootPath");
17
- var _tagProcessor = require("./tag-processor");
17
+ var _tagProcessor = _interopRequireDefault(require("./tagProcessor"));
18
18
  var _configUtils = require("./setup/config-utils");
19
19
  var _browserTypes = require("./constants/browserTypes");
20
20
  var _ConfigurationHelper = require("./configuration/ConfigurationHelper");
@@ -122,7 +122,8 @@ function main() {
122
122
 
123
123
  //This is only used for pass the user arguments to need places in legacy code. We need to rewamp that also.
124
124
  const userArgsObject = userArgConfig.getAll();
125
- const tagArgs = (0, _tagProcessor.tagProcessor)(userArgsObject, editionOrder);
125
+ const tagProcessor = new _tagProcessor.default(editionOrder);
126
+ const tagArgs = tagProcessor.processTags(userArgsObject);
126
127
  const playwrightArgs = getPlaywrightArgs(userArgsObject, debug, bddMode, tagArgs, headless);
127
128
  const playwrightPath = _path.default.resolve((0, _rootPath.getExecutableBinaryPath)('playwright'));
128
129
  const command = playwrightPath;
@@ -7,40 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _parseUserArgs = _interopRequireDefault(require("./helpers/parseUserArgs"));
9
9
  var _readConfigFile = require("./readConfigFile");
10
- var _tagProcessor = require("./tag-processor");
10
+ var _tagProcessor = _interopRequireDefault(require("./tagProcessor"));
11
11
  var _testRunner = require("./test-runner");
12
12
  var _logger = require("../../utils/logger");
13
- // @cucumber/gherkins need to be includ in package.json
14
-
15
- // const getFeatureFiles = (dir) => {
16
- // let featureFiles = [];
17
- // const files = fs.readdirSync(dir, { withFileTypes: true });
18
- // files.forEach(file => {
19
- // const fullPath = path.join(dir, file.name);
20
- // if (file.isDirectory()) {
21
- // featureFiles = featureFiles.concat(getFeatureFiles(fullPath));
22
- // } else if (file.isFile() && fullPath.endsWith('.feature')) {
23
- // featureFiles.push(fullPath);
24
- // }
25
- // });
26
- // return featureFiles;
27
- // };
28
-
29
- //const validateFeatureFiles = () => {
30
- // const featuresDir = path.join(process.cwd(), 'uat/modules');
31
- // const parser = new Parser();
32
- // const featureFiles = getFeatureFiles(featuresDir);
33
- // featureFiles.forEach( filePath => {
34
- // const featureFileContent = fs.readFileSync(filePath, 'utf-8');
35
- // try {
36
- // parser.parse(featureFileContent);
37
- // console.log(`${filePath}: Feature file is valid!`);
38
- // } catch (error) {
39
- // console.error(`${filePath}: Feature file is invalid - ${error.message}`);
40
- // }
41
- // })
42
- //}
43
-
44
13
  const validateFeatureFiles = () => {
45
14
  const userArgsObject = (0, _parseUserArgs.default)();
46
15
  const uatConfig = (0, _readConfigFile.generateConfigFromFile)();
@@ -48,7 +17,8 @@ const validateFeatureFiles = () => {
48
17
  editionOrder
49
18
  } = uatConfig;
50
19
  const configPath = (0, _readConfigFile.isUserConfigFileAvailable)() ? require.resolve('./setup/config-creator.js') : require.resolve('../../../playwright.config.js');
51
- const tagArgs = (0, _tagProcessor.tagProcessor)(userArgsObject, editionOrder);
20
+ const tagProcessor = new _tagProcessor.default(editionOrder);
21
+ const tagArgs = tagProcessor.processTags(userArgsObject);
52
22
  (0, _testRunner.runPreprocessing)(tagArgs, configPath).then(() => {
53
23
  _logger.Logger.log(_logger.Logger.SUCCESS_TYPE, 'Feature files validated successfully.');
54
24
  }).catch(error => {
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _tagProcessor = _interopRequireDefault(require("../../../../../src/core/playwright/tagProcessor"));
5
+ var _logger = require("../../../../utils/logger");
6
+ jest.mock('../../../../utils/logger');
7
+ describe('TagProcessor', () => {
8
+ const editionOrder = ['edition1', 'edition2', 'edition3', 'edition4'];
9
+ beforeEach(() => {
10
+ jest.clearAllMocks();
11
+ });
12
+ test('should return tagArgs if no edition is provided', () => {
13
+ const tagProcessor = new _tagProcessor.default(editionOrder);
14
+ const userArgs = {
15
+ tags: 'tag1',
16
+ edition: null
17
+ };
18
+ const result = tagProcessor.processTags(userArgs);
19
+ expect(result).toBe('tag1');
20
+ });
21
+ test('should handle a single edition with <= operator', () => {
22
+ const tagProcessor = new _tagProcessor.default(editionOrder);
23
+ const userArgs = {
24
+ tags: 'tag1',
25
+ edition: '<=edition2'
26
+ };
27
+ const result = tagProcessor.processTags(userArgs);
28
+ expect(result).toBe('tag1 and not (@edition_edition3 or @edition_edition4)');
29
+ });
30
+ test('should handle a single edition with >= operator', () => {
31
+ const tagProcessor = new _tagProcessor.default(editionOrder);
32
+ const userArgs = {
33
+ tags: 'tag1',
34
+ edition: '>=edition2'
35
+ };
36
+ const result = tagProcessor.processTags(userArgs);
37
+ expect(result).toBe('tag1 and not (@edition_edition1)');
38
+ });
39
+ test('should handle a single edition with < operator', () => {
40
+ const tagProcessor = new _tagProcessor.default(editionOrder);
41
+ const userArgs = {
42
+ tags: 'tag1',
43
+ edition: '<edition3'
44
+ };
45
+ const result = tagProcessor.processTags(userArgs);
46
+ expect(result).toBe('tag1 and not (@edition_edition3 or @edition_edition4)');
47
+ });
48
+ test('should handle a single edition with > operator', () => {
49
+ const tagProcessor = new _tagProcessor.default(editionOrder);
50
+ const userArgs = {
51
+ tags: 'tag1',
52
+ edition: '>edition1'
53
+ };
54
+ const result = tagProcessor.processTags(userArgs);
55
+ expect(result).toBe('tag1 and not (@edition_edition1)');
56
+ });
57
+ test('should handle a single edition with no operator', () => {
58
+ const tagProcessor = new _tagProcessor.default(editionOrder);
59
+ const userArgs = {
60
+ tags: 'tag1',
61
+ edition: 'edition2'
62
+ };
63
+ const result = tagProcessor.processTags(userArgs);
64
+ expect(result).toBe('tag1 and not (@edition_edition1 or @edition_edition3 or @edition_edition4)');
65
+ });
66
+ test('should log a message if edition is not found', () => {
67
+ const tagProcessor = new _tagProcessor.default(editionOrder);
68
+ const userArgs = {
69
+ tags: 'tag1',
70
+ edition: 'nonexistentEdition'
71
+ };
72
+ const result = tagProcessor.processTags(userArgs);
73
+ expect(result).toBe('tag1');
74
+ expect(_logger.Logger.log).toHaveBeenCalledWith(_logger.Logger.INFO_TYPE, expect.stringContaining('No matching editions for nonexistentEdition found.'));
75
+ });
76
+ test('should handle multiple editions', () => {
77
+ const tagProcessor = new _tagProcessor.default(editionOrder);
78
+ const userArgs = {
79
+ tags: 'tag1',
80
+ edition: 'edition1,edition3'
81
+ };
82
+ const result = tagProcessor.processTags(userArgs);
83
+ expect(result).toBe('tag1 and not (@edition_edition2 or @edition_edition4)');
84
+ });
85
+ test('should build tags correctly when tags are empty', () => {
86
+ const tagProcessor = new _tagProcessor.default(editionOrder);
87
+ const userArgs = {
88
+ tags: '',
89
+ edition: 'edition1'
90
+ };
91
+ const result = tagProcessor.processTags(userArgs);
92
+ expect(result).toBe('not (@edition_edition2 or @edition_edition3 or @edition_edition4)');
93
+ });
94
+ });
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  var _validateFeature = _interopRequireDefault(require("../../../../core/playwright/validateFeature"));
5
5
  var _parseUserArgs = _interopRequireDefault(require("../../../../core/playwright/helpers/parseUserArgs"));
6
6
  var _readConfigFile = require("../../../../core/playwright/readConfigFile");
7
- var _tagProcessor = require("../../../../core/playwright/tag-processor");
7
+ var _tagProcessor = _interopRequireDefault(require("../../../../core/playwright/tagProcessor"));
8
8
  var _testRunner = require("../../../../core/playwright/test-runner");
9
9
  var _logger = require("../../../../utils/logger");
10
10
  jest.mock('../../../../core/playwright/helpers/parseUserArgs', () => ({
@@ -12,7 +12,7 @@ jest.mock('../../../../core/playwright/helpers/parseUserArgs', () => ({
12
12
  default: jest.fn()
13
13
  }));
14
14
  jest.mock('../../../../core/playwright/readConfigFile');
15
- jest.mock('../../../../core/playwright/tag-processor');
15
+ jest.mock('../../../../core/playwright/tagProcessor');
16
16
  jest.mock('../../../../core/playwright/test-runner');
17
17
  jest.mock('../../../../utils/logger', () => ({
18
18
  __esModule: true,
@@ -23,8 +23,13 @@ jest.mock('../../../../utils/logger', () => ({
23
23
  }
24
24
  }));
25
25
  describe('validateFeatureFiles', () => {
26
+ let tagProcessorInstance;
26
27
  beforeEach(() => {
27
28
  jest.clearAllMocks();
29
+ tagProcessorInstance = {
30
+ processTags: jest.fn()
31
+ };
32
+ _tagProcessor.default.mockImplementation(() => tagProcessorInstance);
28
33
  });
29
34
  test('runPreprocessing with correct arguments and log success', async () => {
30
35
  const mockUserArgs = {
@@ -37,19 +42,19 @@ describe('validateFeatureFiles', () => {
37
42
  _readConfigFile.generateConfigFromFile.mockReturnValue(mockConfig);
38
43
  _readConfigFile.isUserConfigFileAvailable.mockReturnValue(true);
39
44
  const mockTagArgs = ['@beta_admin'];
40
- _tagProcessor.tagProcessor.mockReturnValue(mockTagArgs);
45
+ tagProcessorInstance.processTags.mockReturnValue(mockTagArgs);
41
46
  _testRunner.runPreprocessing.mockResolvedValueOnce();
42
47
  await (0, _validateFeature.default)();
43
48
  expect(_parseUserArgs.default).toHaveBeenCalled();
44
49
  expect(_readConfigFile.generateConfigFromFile).toHaveBeenCalled();
45
50
  expect(_readConfigFile.isUserConfigFileAvailable).toHaveBeenCalled();
46
- expect(_tagProcessor.tagProcessor).toHaveBeenCalledWith(mockUserArgs, ["beta", "enterprice"]);
51
+ expect(tagProcessorInstance.processTags).toHaveBeenCalledWith(mockUserArgs);
47
52
  expect(_testRunner.runPreprocessing).toHaveBeenCalledWith(mockTagArgs, expect.stringContaining('config-creator.js'));
48
53
  expect(_logger.Logger.log).toHaveBeenCalledWith(_logger.Logger.SUCCESS_TYPE, 'Feature files validated successfully.');
49
54
  });
50
55
  test('runPreprocessing with playwright conf', async () => {
51
56
  const mockTagArgs = ['@beta_admin'];
52
- _tagProcessor.tagProcessor.mockReturnValue(mockTagArgs);
57
+ tagProcessorInstance.processTags.mockReturnValue(mockTagArgs);
53
58
  _readConfigFile.isUserConfigFileAvailable.mockReturnValue(false);
54
59
  _testRunner.runPreprocessing.mockResolvedValueOnce();
55
60
  await (0, _validateFeature.default)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.4.6-experimental",
3
+ "version": "0.4.7-experimental",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -1,68 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.tagProcessor = tagProcessor;
7
- var _logger = require("../../utils/logger");
8
- /* eslint-disable dot-notation */
9
-
10
- function getTagsString(tags, editionTags) {
11
- return tags && tags !== '' ? `${tags} and not (${editionTags})` : `not (${editionTags})`;
12
- }
13
- function getEdition(edition) {
14
- if (edition.startsWith('<=')) {
15
- return ['<=', edition.slice(2)];
16
- } else if (edition.startsWith('>=')) {
17
- return ['>=', edition.slice(2)];
18
- } else if (edition.startsWith('<')) {
19
- return ['<', edition.slice(1)];
20
- } else if (edition.startsWith('>')) {
21
- return ['>', edition.slice(1)];
22
- }
23
- return [null, edition];
24
- }
25
- function editionPreprocessing(editionOrder, selectedEdition) {
26
- const [operator, editionToBeSearched] = getEdition(selectedEdition.toLowerCase());
27
- const index = editionOrder.findIndex(edition => edition.toLowerCase() === editionToBeSearched);
28
- if (index !== -1) {
29
- let resultArray;
30
- if (operator === '<=') {
31
- resultArray = editionOrder.slice(index + 1);
32
- } else if (operator === '>=') {
33
- resultArray = editionOrder.slice(0, index);
34
- } else if (operator === '<') {
35
- resultArray = editionOrder.slice(index);
36
- } else if (operator === '>') {
37
- resultArray = editionOrder.slice(0, index + 1);
38
- } else {
39
- resultArray = editionOrder.filter((_, order) => order !== index);
40
- }
41
- return resultArray;
42
- }
43
- _logger.Logger.log(_logger.Logger.INFO_TYPE, `No matching editions ${selectedEdition} found. Running with default edition`);
44
- return [];
45
- }
46
- function buildEditionTags(editionArgs, operator) {
47
- return editionArgs.map(edition => `@edition_${edition}`).join(` ${operator} `);
48
- }
49
- function tagProcessor(userArgsObject, editionOrder) {
50
- let tagArgs = userArgsObject['tags'];
51
- const edition = userArgsObject['edition'] || null;
52
- if (edition !== null) {
53
- let editionsArray = edition.split(',');
54
- if (editionsArray.length === 1) {
55
- const editionArgs = editionPreprocessing(editionOrder, edition);
56
- if (editionArgs && editionArgs.length > 0) {
57
- const editionTags = buildEditionTags(editionArgs, 'or');
58
- tagArgs = `${getTagsString(tagArgs, editionTags)}`;
59
- }
60
- } else {
61
- // More than one edition given
62
- const filteredEditions = editionOrder.filter(edition => !editionsArray.includes(edition));
63
- const editionTags = buildEditionTags(filteredEditions, 'or');
64
- tagArgs = `${getTagsString(tagArgs, editionTags)}`;
65
- }
66
- }
67
- return tagArgs;
68
- }