@rockcarver/frodo-cli 0.11.1-0 → 0.11.1-1
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/CHANGELOG.md +5 -1
- package/package.json +12 -10
- package/src/app.js +3 -3
- package/.eslintrc +0 -29
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/README.md +0 -213
- package/.github/workflows/pipeline.yml +0 -495
- package/.prettierrc +0 -6
- package/CODE_OF_CONDUCT.md +0 -128
- package/docs/BINARIES.md +0 -22
- package/docs/CONTRIBUTE.md +0 -96
- package/docs/PIPELINE.md +0 -169
- package/docs/images/macos_warn1.png +0 -0
- package/docs/images/macos_warn2.png +0 -0
- package/docs/images/macos_warn3.png +0 -0
- package/docs/images/npm_versioning_guidelines.png +0 -0
- package/docs/images/release_pipeline.png +0 -0
- package/gulpfile.js +0 -49
- package/jsconfig.json +0 -6
- package/resources/sampleEntitiesFile.json +0 -8
- package/resources/sampleEnvFile.env +0 -2
- package/src/cli/journey/journey-delete.e2e.test_.js +0 -380
- package/src/cli/journey/journey-list.e2e.test_.js +0 -142
- package/src/cli/theme/theme-delete.e2e.test_.js +0 -178
- package/src/cli/theme/theme-list.e2e.test_.js +0 -119
- package/test/client_cli/en/conn-add.test.js +0 -37
- package/test/client_cli/en/conn-delete.test.js +0 -37
- package/test/client_cli/en/conn-list.test.js +0 -37
- package/test/client_cli/en/conn.test.js +0 -65
- package/test/client_cli/en/email-template-import.test.js +0 -156
- package/test/client_cli/en/email-template.test.js +0 -79
- package/test/client_cli/en/email-templates-export.test.js +0 -208
- package/test/client_cli/en/email-templates-list.test.js +0 -139
- package/test/client_cli/en/idm-count.test.js +0 -131
- package/test/client_cli/en/idm-export.test.js +0 -149
- package/test/client_cli/en/idm-import.test_.js +0 -101
- package/test/client_cli/en/idm-list.test.js +0 -109
- package/test/client_cli/en/idm.test.js +0 -82
- package/test/client_cli/en/info.test.js +0 -136
- package/test/client_cli/en/journey-describe.test.js +0 -194
- package/test/client_cli/en/journey-export.test.js +0 -231
- package/test/client_cli/en/journey-import.test.js +0 -212
- package/test/client_cli/en/journey-list.test.js +0 -173
- package/test/client_cli/en/journey-prune.test.js +0 -159
- package/test/client_cli/en/journey.test.js +0 -111
- package/test/client_cli/en/logs-list.test.js +0 -81
- package/test/client_cli/en/logs-tail.test.js +0 -130
- package/test/client_cli/en/logs.test.js +0 -65
- package/test/client_cli/en/root.test.js +0 -93
- package/test/client_cli/en/script-export.test.js +0 -230
- package/test/client_cli/en/script-import.test.js +0 -176
- package/test/client_cli/en/script-list.test.js +0 -159
- package/test/client_cli/en/script.test.js +0 -79
- package/test/client_cli/utils/utils.js +0 -63
- package/test/e2e/journey/baseline/ForgottenUsername.journey.json +0 -216
- package/test/e2e/journey/baseline/Login.journey.json +0 -205
- package/test/e2e/journey/baseline/PasswordGrant.journey.json +0 -139
- package/test/e2e/journey/baseline/ProgressiveProfile.journey.json +0 -198
- package/test/e2e/journey/baseline/Registration.journey.json +0 -249
- package/test/e2e/journey/baseline/ResetPassword.journey.json +0 -268
- package/test/e2e/journey/baseline/UpdatePassword.journey.json +0 -323
- package/test/e2e/journey/baseline/allAlphaJourneys.journeys.json +0 -1520
- package/test/e2e/journey/delete/ForgottenUsername.journey.json +0 -216
- package/test/e2e/journey/delete/Login.journey.json +0 -205
- package/test/e2e/journey/delete/PasswordGrant.journey.json +0 -139
- package/test/e2e/journey/delete/ProgressiveProfile.journey.json +0 -198
- package/test/e2e/journey/delete/Registration.journey.json +0 -249
- package/test/e2e/journey/delete/ResetPassword.journey.json +0 -268
- package/test/e2e/journey/delete/UpdatePassword.journey.json +0 -323
- package/test/e2e/journey/delete/deleteMe.journey.json +0 -230
- package/test/e2e/journey/list/Disabled.journey.json +0 -43
- package/test/e2e/journey/list/ForgottenUsername.journey.json +0 -216
- package/test/e2e/journey/list/Login.journey.json +0 -205
- package/test/e2e/journey/list/PasswordGrant.journey.json +0 -139
- package/test/e2e/journey/list/ProgressiveProfile.journey.json +0 -198
- package/test/e2e/journey/list/Registration.journey.json +0 -249
- package/test/e2e/journey/list/ResetPassword.journey.json +0 -268
- package/test/e2e/journey/list/UpdatePassword.journey.json +0 -323
- package/test/e2e/theme/baseline/Contrast.theme.json +0 -95
- package/test/e2e/theme/baseline/Highlander.theme.json +0 -95
- package/test/e2e/theme/baseline/Robroy.theme.json +0 -95
- package/test/e2e/theme/baseline/Starter-Theme.theme.json +0 -94
- package/test/e2e/theme/baseline/Zardoz.theme.json +0 -95
- package/test/e2e/theme/import/Contrast.theme.json +0 -95
- package/test/e2e/theme/import/Highlander.theme.json +0 -95
- package/test/e2e/theme/import/Robroy.theme.json +0 -95
- package/test/e2e/theme/import/Starter-Theme.theme.json +0 -94
- package/test/e2e/theme/import/Zardoz.default.theme.json +0 -95
- package/test/fs_tmp/.gitkeep +0 -2
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
// import { jest } from '@jest/globals';
|
|
2
|
-
import { spawn, spawnSync } from 'child_process';
|
|
3
|
-
|
|
4
|
-
const ansiEscapeCodes =
|
|
5
|
-
// eslint-disable-next-line no-control-regex
|
|
6
|
-
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* delete all themes and import baseline and additional test themes
|
|
10
|
-
*/
|
|
11
|
-
beforeAll(async () => {
|
|
12
|
-
// delete all themes
|
|
13
|
-
const deleteThemesCmd = spawnSync('frodo', [
|
|
14
|
-
'theme',
|
|
15
|
-
'delete',
|
|
16
|
-
'--all',
|
|
17
|
-
'frodo-dev',
|
|
18
|
-
]);
|
|
19
|
-
if (deleteThemesCmd.status > 0) {
|
|
20
|
-
console.error(deleteThemesCmd.stderr.toString());
|
|
21
|
-
console.log(deleteThemesCmd.stdout.toString());
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// import baseline themes
|
|
25
|
-
const importBaselineThemesCmd = spawnSync(
|
|
26
|
-
'frodo',
|
|
27
|
-
['theme', 'import', '--all-separate', 'frodo-dev'],
|
|
28
|
-
{
|
|
29
|
-
cwd: `test/e2e/theme/baseline`,
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
if (importBaselineThemesCmd.status > 0) {
|
|
33
|
-
console.error(importBaselineThemesCmd.stderr.toString());
|
|
34
|
-
console.log(importBaselineThemesCmd.stdout.toString());
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
describe('frodo theme list', () => {
|
|
39
|
-
it('"frodo theme list": should list the names of the default themes', (done) => {
|
|
40
|
-
const themeList = spawn('frodo', ['theme', 'list', 'frodo-dev']);
|
|
41
|
-
const expected = [
|
|
42
|
-
'Contrast',
|
|
43
|
-
'Highlander',
|
|
44
|
-
'Robroy',
|
|
45
|
-
'Starter Theme',
|
|
46
|
-
'Zardoz',
|
|
47
|
-
'',
|
|
48
|
-
].join('\n');
|
|
49
|
-
|
|
50
|
-
const chunks = [];
|
|
51
|
-
themeList.stdout.on('data', (chunk) => {
|
|
52
|
-
chunks.push(chunk);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
themeList.stdout.on('end', () => {
|
|
56
|
-
const output = Buffer.concat(chunks)
|
|
57
|
-
.toString()
|
|
58
|
-
.replace(ansiEscapeCodes, '');
|
|
59
|
-
try {
|
|
60
|
-
expect(output).toBe(expected);
|
|
61
|
-
done();
|
|
62
|
-
} catch (error) {
|
|
63
|
-
done(error);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
const expectedLong = [
|
|
69
|
-
'Name │Id │Default',
|
|
70
|
-
'Contrast │cd6c93e2-52e2-4340-9770-66a588343841│ ',
|
|
71
|
-
'Highlander │00203891-dde0-4114-b27a-219ae0b43a61│ ',
|
|
72
|
-
'Robroy │b82755e8-fe9a-4d27-b66b-45e37ae12345│ ',
|
|
73
|
-
'Starter Theme│86ce2f64-586d-44fe-8593-b12a85aac68d│Yes ',
|
|
74
|
-
'Zardoz │4ded6d91-ceea-400a-ae3f-42209f1b0e06│ ',
|
|
75
|
-
'',
|
|
76
|
-
].join('\n');
|
|
77
|
-
|
|
78
|
-
it('"frodo theme list -l": should list the names, ids, and default flag of the baseline themes', (done) => {
|
|
79
|
-
const themeList = spawn('frodo', ['theme', 'list', '-l', 'frodo-dev']);
|
|
80
|
-
|
|
81
|
-
const chunks = [];
|
|
82
|
-
themeList.stdout.on('data', (chunk) => {
|
|
83
|
-
chunks.push(chunk);
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
themeList.stdout.on('end', () => {
|
|
87
|
-
const output = Buffer.concat(chunks)
|
|
88
|
-
.toString()
|
|
89
|
-
.replace(ansiEscapeCodes, '');
|
|
90
|
-
try {
|
|
91
|
-
expect(output).toBe(expectedLong);
|
|
92
|
-
done();
|
|
93
|
-
} catch (error) {
|
|
94
|
-
done(error);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('"frodo theme list --long": should list the names, status, and default flag of the baseline themes', (done) => {
|
|
100
|
-
const themeList = spawn('frodo', ['theme', 'list', '--long', 'frodo-dev']);
|
|
101
|
-
|
|
102
|
-
const chunks = [];
|
|
103
|
-
themeList.stdout.on('data', (chunk) => {
|
|
104
|
-
chunks.push(chunk);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
themeList.stdout.on('end', () => {
|
|
108
|
-
const output = Buffer.concat(chunks)
|
|
109
|
-
.toString()
|
|
110
|
-
.replace(ansiEscapeCodes, '');
|
|
111
|
-
try {
|
|
112
|
-
expect(output).toBe(expectedLong);
|
|
113
|
-
done();
|
|
114
|
-
} catch (error) {
|
|
115
|
-
done(error);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import { node14Compatibility } from '../utils/utils.js';
|
|
4
|
-
|
|
5
|
-
node14Compatibility();
|
|
6
|
-
|
|
7
|
-
const exec = promisify(cp.exec);
|
|
8
|
-
const CMD = 'frodo connections add --help';
|
|
9
|
-
const { stdout } = await exec(CMD);
|
|
10
|
-
|
|
11
|
-
test("CLI help interface for 'add' Usage should be expected english", async () => {
|
|
12
|
-
// Arrange
|
|
13
|
-
const expected = `
|
|
14
|
-
Usage: frodo conn add [options] <host> [user] [password] [key] [secret]
|
|
15
|
-
`.trim();
|
|
16
|
-
// Act
|
|
17
|
-
const testLine = stdout
|
|
18
|
-
.split(/\n/)
|
|
19
|
-
.find((line) => line.trim().startsWith('Usage:'))
|
|
20
|
-
.trim();
|
|
21
|
-
// Assert
|
|
22
|
-
expect(testLine).toBe(expected);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("CLI help interface 'connections add' description at line 2 should be expected english", async () => {
|
|
26
|
-
// Arrange
|
|
27
|
-
const expected = `
|
|
28
|
-
Add a new connection profiles. You have to specify a URL, username and password at a minimum.
|
|
29
|
-
`.trim();
|
|
30
|
-
// Act
|
|
31
|
-
const testLine = stdout
|
|
32
|
-
.split(/\n/)
|
|
33
|
-
.map((line) => line.trim())
|
|
34
|
-
.at(2);
|
|
35
|
-
// Assert
|
|
36
|
-
expect(testLine).toBe(expected);
|
|
37
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import { node14Compatibility } from '../utils/utils.js';
|
|
4
|
-
|
|
5
|
-
node14Compatibility();
|
|
6
|
-
|
|
7
|
-
const exec = promisify(cp.exec);
|
|
8
|
-
const CMD = 'frodo connections delete --help';
|
|
9
|
-
const { stdout } = await exec(CMD);
|
|
10
|
-
|
|
11
|
-
test("CLI help interface for 'delete' Usage should be expected english", async () => {
|
|
12
|
-
// Arrange
|
|
13
|
-
const expected = `
|
|
14
|
-
Usage: frodo conn delete [options] <host>
|
|
15
|
-
`.trim();
|
|
16
|
-
// Act
|
|
17
|
-
const testLine = stdout
|
|
18
|
-
.split(/\n/)
|
|
19
|
-
.find((line) => line.trim().startsWith('Usage:'))
|
|
20
|
-
.trim();
|
|
21
|
-
// Assert
|
|
22
|
-
expect(testLine).toBe(expected);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("CLI help interface 'conn delete' description at line 2 should be expected english", async () => {
|
|
26
|
-
// Arrange
|
|
27
|
-
const expected = `
|
|
28
|
-
Delete connection profiles.
|
|
29
|
-
`.trim();
|
|
30
|
-
// Act
|
|
31
|
-
const testLine = stdout
|
|
32
|
-
.split(/\n/)
|
|
33
|
-
.map((line) => line.trim())
|
|
34
|
-
.at(2);
|
|
35
|
-
// Assert
|
|
36
|
-
expect(testLine).toBe(expected);
|
|
37
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import { node14Compatibility } from '../utils/utils.js';
|
|
4
|
-
|
|
5
|
-
node14Compatibility();
|
|
6
|
-
|
|
7
|
-
const exec = promisify(cp.exec);
|
|
8
|
-
const CMD = 'frodo connections list --help';
|
|
9
|
-
const { stdout } = await exec(CMD);
|
|
10
|
-
|
|
11
|
-
test("CLI help interface for 'list' Usage should be expected english", async () => {
|
|
12
|
-
// Arrange
|
|
13
|
-
const expected = `
|
|
14
|
-
Usage: frodo conn list [options]
|
|
15
|
-
`.trim();
|
|
16
|
-
// Act
|
|
17
|
-
const testLine = stdout
|
|
18
|
-
.split(/\n/)
|
|
19
|
-
.find((line) => line.trim().startsWith('Usage:'))
|
|
20
|
-
.trim();
|
|
21
|
-
// Assert
|
|
22
|
-
expect(testLine).toBe(expected);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("CLI help interface 'connections List' description at line 2 should be expected english", async () => {
|
|
26
|
-
// Arrange
|
|
27
|
-
const expected = `
|
|
28
|
-
List connection profiles.
|
|
29
|
-
`.trim();
|
|
30
|
-
// Act
|
|
31
|
-
const testLine = stdout
|
|
32
|
-
.split(/\n/)
|
|
33
|
-
.map((line) => line.trim())
|
|
34
|
-
.at(2);
|
|
35
|
-
// Assert
|
|
36
|
-
expect(testLine).toBe(expected);
|
|
37
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import { node14Compatibility } from '../utils/utils.js';
|
|
4
|
-
|
|
5
|
-
node14Compatibility();
|
|
6
|
-
|
|
7
|
-
const exec = promisify(cp.exec);
|
|
8
|
-
const CMD = 'frodo connections --help';
|
|
9
|
-
const { stdout } = await exec(CMD);
|
|
10
|
-
|
|
11
|
-
test("CLI help interface for 'connections' Usage should be expected english", async () => {
|
|
12
|
-
// Arrange
|
|
13
|
-
const expected = `
|
|
14
|
-
Usage: frodo conn|connection [options] [command]
|
|
15
|
-
`.trim();
|
|
16
|
-
// Act
|
|
17
|
-
const testLine = stdout
|
|
18
|
-
.split(/\n/)
|
|
19
|
-
.find((line) => line.trim().startsWith('Usage:'))
|
|
20
|
-
.trim();
|
|
21
|
-
// Assert
|
|
22
|
-
expect(testLine).toBe(expected);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test('CLI help interface connections description at line 2 should be expected english', async () => {
|
|
26
|
-
// Arrange
|
|
27
|
-
const expected = `
|
|
28
|
-
Manage connection profiles.
|
|
29
|
-
`.trim();
|
|
30
|
-
// Act
|
|
31
|
-
const testLine = stdout
|
|
32
|
-
.split(/\n/)
|
|
33
|
-
.map((line) => line.trim())
|
|
34
|
-
.at(2);
|
|
35
|
-
// Assert
|
|
36
|
-
expect(testLine).toBe(expected);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test("CLI help interface 'list' description should be expected english", async () => {
|
|
40
|
-
// Arrange
|
|
41
|
-
const expected = `
|
|
42
|
-
list List connection profiles.
|
|
43
|
-
`.trim();
|
|
44
|
-
// Act
|
|
45
|
-
const testLine = stdout
|
|
46
|
-
.split(/\n/)
|
|
47
|
-
.find((line) => line.trim().startsWith('list'))
|
|
48
|
-
.trim();
|
|
49
|
-
// Assert
|
|
50
|
-
expect(testLine).toBe(expected);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test("CLI help interface 'delete' description should be expected english", async () => {
|
|
54
|
-
// Arrange
|
|
55
|
-
const expected = `
|
|
56
|
-
delete Delete connection profiles.
|
|
57
|
-
`.trim();
|
|
58
|
-
// Act
|
|
59
|
-
const testLine = stdout
|
|
60
|
-
.split(/\n/)
|
|
61
|
-
.find((line) => line.trim().startsWith('delete'))
|
|
62
|
-
.trim();
|
|
63
|
-
// Assert
|
|
64
|
-
expect(testLine).toBe(expected);
|
|
65
|
-
});
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import {
|
|
4
|
-
node14Compatibility,
|
|
5
|
-
crudeMultilineTakeUntil,
|
|
6
|
-
collapseWhitespace,
|
|
7
|
-
} from '../utils/utils.js';
|
|
8
|
-
|
|
9
|
-
node14Compatibility();
|
|
10
|
-
|
|
11
|
-
const exec = promisify(cp.exec);
|
|
12
|
-
const CMD = 'frodo email template import --help';
|
|
13
|
-
const { stdout } = await exec(CMD);
|
|
14
|
-
|
|
15
|
-
test("CLI help interface for 'email_templates import' Usage should be expected english", async () => {
|
|
16
|
-
// Arrange
|
|
17
|
-
const expected = `
|
|
18
|
-
Usage: frodo email template import [options] <host> [realm] [user] [password]
|
|
19
|
-
`.trim();
|
|
20
|
-
// Act
|
|
21
|
-
const testLine = stdout
|
|
22
|
-
.split(/\n/)
|
|
23
|
-
.find((line) => line.trim().startsWith('Usage:'))
|
|
24
|
-
.trim();
|
|
25
|
-
// Assert
|
|
26
|
-
expect(testLine).toBe(expected);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test("CLI help interface 'email_templates import' description at line 2 should be expected english", async () => {
|
|
30
|
-
// Arrange
|
|
31
|
-
const expected = `
|
|
32
|
-
Import email templates.
|
|
33
|
-
`.trim();
|
|
34
|
-
// Act
|
|
35
|
-
const testLine = stdout
|
|
36
|
-
.split(/\n/)
|
|
37
|
-
.map((line) => line.trim())
|
|
38
|
-
.at(2);
|
|
39
|
-
// Assert
|
|
40
|
-
expect(testLine).toBe(expected);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test("CLI help interface 'import argument host' description should be expected english multiline", async () => {
|
|
44
|
-
// Arrange
|
|
45
|
-
const expected = collapseWhitespace(`
|
|
46
|
-
host Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a unique substring. realm Realm. Specify realm as '/' for the root realm or 'realm' or '/parent/child' otherwise. (default: "alpha" for Identity Cloud tenants, "/" otherwise.)
|
|
47
|
-
`);
|
|
48
|
-
// Act
|
|
49
|
-
const testLine = collapseWhitespace(
|
|
50
|
-
crudeMultilineTakeUntil(
|
|
51
|
-
stdout,
|
|
52
|
-
' host ',
|
|
53
|
-
' user '
|
|
54
|
-
)
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
// Assert
|
|
58
|
-
expect(testLine).toBe(expected);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
test("CLI help interface 'import argument user' description should be expected english multiline", async () => {
|
|
62
|
-
// Arrange
|
|
63
|
-
const expected = collapseWhitespace(`
|
|
64
|
-
user Username to login with. Must be an admin user with appropriate
|
|
65
|
-
rights to manage authentication journeys/trees.
|
|
66
|
-
`);
|
|
67
|
-
// Act
|
|
68
|
-
const testLine = collapseWhitespace(
|
|
69
|
-
crudeMultilineTakeUntil(
|
|
70
|
-
stdout,
|
|
71
|
-
' user ',
|
|
72
|
-
' password '
|
|
73
|
-
)
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
// Assert
|
|
77
|
-
expect(testLine).toBe(expected);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
test("CLI help interface 'import argument password' description should be expected english", async () => {
|
|
81
|
-
// Arrange
|
|
82
|
-
const expectedDescription = `
|
|
83
|
-
password Password.
|
|
84
|
-
`.trim();
|
|
85
|
-
// Act
|
|
86
|
-
const testLine = stdout
|
|
87
|
-
.split(/\n/)
|
|
88
|
-
.find((line) => line.trim().startsWith('password'))
|
|
89
|
-
.trim();
|
|
90
|
-
// Assert
|
|
91
|
-
expect(testLine).toBe(expectedDescription);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
test("CLI help interface 'import option -m, --type <type>' description should be expected english multiline", async () => {
|
|
95
|
-
// Arrange
|
|
96
|
-
const expected = collapseWhitespace(`
|
|
97
|
-
-m, --type <type> Override auto-detected deployment type. Valid values for
|
|
98
|
-
type:
|
|
99
|
-
classic: A classic Access Management-only deployment
|
|
100
|
-
with custom layout and configuration.
|
|
101
|
-
cloud: A ForgeRock Identity Cloud environment.
|
|
102
|
-
forgeops: A ForgeOps CDK or CDM deployment.
|
|
103
|
-
The detected or provided deployment type controls certain
|
|
104
|
-
behavior like obtaining an Identity Management admin
|
|
105
|
-
token or not and whether to export/import referenced
|
|
106
|
-
email templates or how to walk through the tenant admin
|
|
107
|
-
login flow of Identity Cloud and handle MFA (choices:
|
|
108
|
-
"classic", "cloud", "forgeops")
|
|
109
|
-
`);
|
|
110
|
-
// Act
|
|
111
|
-
const testLine = collapseWhitespace(
|
|
112
|
-
crudeMultilineTakeUntil(
|
|
113
|
-
stdout,
|
|
114
|
-
' -m, --type <type> ',
|
|
115
|
-
' -k, --insecure '
|
|
116
|
-
)
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
// Assert
|
|
120
|
-
expect(testLine).toBe(expected);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
test("CLI help interface 'import option -k, --insecure' description should be expected english multiline", async () => {
|
|
124
|
-
// Arrange
|
|
125
|
-
const expected = collapseWhitespace(`
|
|
126
|
-
-k, --insecure Allow insecure connections when using SSL/TLS. Has no effect when using a network proxy for https (HTTPS_PROXY=http://<host>:<port>), in that case the proxy must provide this capability. (default: Don't allow insecure connections) -i, --template-id <template-id> Email template id/name. If specified, -a and -A are ignored.
|
|
127
|
-
`);
|
|
128
|
-
// Act
|
|
129
|
-
const testLine = collapseWhitespace(
|
|
130
|
-
crudeMultilineTakeUntil(
|
|
131
|
-
stdout,
|
|
132
|
-
' -k, --insecure ',
|
|
133
|
-
' -f, --file <file> '
|
|
134
|
-
)
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
// Assert
|
|
138
|
-
expect(testLine).toBe(expected);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
test("CLI help interface 'import option -f, --file <file>' description should be expected english", async () => {
|
|
142
|
-
// Arrange
|
|
143
|
-
const expected = collapseWhitespace(`
|
|
144
|
-
-f, --file <file> Name of the import file.
|
|
145
|
-
`);
|
|
146
|
-
// Act
|
|
147
|
-
const testLine = collapseWhitespace(
|
|
148
|
-
crudeMultilineTakeUntil(
|
|
149
|
-
stdout,
|
|
150
|
-
' -f, --file <file> ',
|
|
151
|
-
' -a, --all '
|
|
152
|
-
)
|
|
153
|
-
);
|
|
154
|
-
// Assert
|
|
155
|
-
expect(testLine).toBe(expected);
|
|
156
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import { node14Compatibility } from '../utils/utils.js';
|
|
4
|
-
|
|
5
|
-
node14Compatibility();
|
|
6
|
-
|
|
7
|
-
const exec = promisify(cp.exec);
|
|
8
|
-
const CMD = 'frodo email template --help';
|
|
9
|
-
const { stdout } = await exec(CMD);
|
|
10
|
-
|
|
11
|
-
test("CLI help interface for 'email_templates' Usage should be expected english", async () => {
|
|
12
|
-
// Arrange
|
|
13
|
-
const expected = `
|
|
14
|
-
Usage: frodo email template [options] [command]
|
|
15
|
-
`.trim();
|
|
16
|
-
// Act
|
|
17
|
-
const testLine = stdout
|
|
18
|
-
.split(/\n/)
|
|
19
|
-
.find((line) => line.trim().startsWith('Usage:'))
|
|
20
|
-
.trim();
|
|
21
|
-
// Assert
|
|
22
|
-
expect(testLine).toBe(expected);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("CLI help interface 'email_templates' description at line 2 should be expected english", async () => {
|
|
26
|
-
// Arrange
|
|
27
|
-
const expected = `
|
|
28
|
-
Manage email templates.
|
|
29
|
-
`.trim();
|
|
30
|
-
// Act
|
|
31
|
-
const testLine = stdout
|
|
32
|
-
.split(/\n/)
|
|
33
|
-
.map((line) => line.trim())
|
|
34
|
-
.at(2);
|
|
35
|
-
// Assert
|
|
36
|
-
expect(testLine).toBe(expected);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test("CLI help interface 'email_templates commands list' description should be expected english", async () => {
|
|
40
|
-
// Arrange
|
|
41
|
-
const expected = `
|
|
42
|
-
list List email templates.
|
|
43
|
-
`.trim();
|
|
44
|
-
// Act
|
|
45
|
-
const testLine = stdout
|
|
46
|
-
.split(/\n/)
|
|
47
|
-
.find((line) => line.trim().startsWith('list'))
|
|
48
|
-
.trim();
|
|
49
|
-
// Assert
|
|
50
|
-
expect(testLine).toBe(expected);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test("CLI help interface 'email_templates commands export' description should be expected english", async () => {
|
|
54
|
-
// Arrange
|
|
55
|
-
const expected = `
|
|
56
|
-
export Export email templates.
|
|
57
|
-
`.trim();
|
|
58
|
-
// Act
|
|
59
|
-
const testLine = stdout
|
|
60
|
-
.split(/\n/)
|
|
61
|
-
.find((line) => line.trim().startsWith('export'))
|
|
62
|
-
.trim();
|
|
63
|
-
// Assert
|
|
64
|
-
expect(testLine).toBe(expected);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
test("CLI help interface 'email_templates commands import' description should be expected english", async () => {
|
|
68
|
-
// Arrange
|
|
69
|
-
const expected = `
|
|
70
|
-
import Import email templates.
|
|
71
|
-
`.trim();
|
|
72
|
-
// Act
|
|
73
|
-
const testLine = stdout
|
|
74
|
-
.split(/\n/)
|
|
75
|
-
.find((line) => line.trim().startsWith('import'))
|
|
76
|
-
.trim();
|
|
77
|
-
// Assert
|
|
78
|
-
expect(testLine).toBe(expected);
|
|
79
|
-
});
|