Skip to content

Commit 5976ad1

Browse files
committed
fix failing tests
1 parent 8f0634f commit 5976ad1

1 file changed

Lines changed: 20 additions & 18 deletions

File tree

tests/onfire-cli.test.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class MockOnFireCLI extends OnFireCLI {
7373
}
7474

7575
const appdistribution = {
76-
distributeLen: 10,
76+
distributeLen: 20,
7777
testers: {
7878
addLen: 5,
7979
removeLen: 5,
@@ -94,22 +94,24 @@ describe("Test loading of Firebase commands", () => {
9494
it("Should load 'appdistribution:distribute' command", async () => {
9595
const firebaseCommands = onfireCLI._getFirebaseCommands();
9696
expect(firebaseCommands["appdistribution:distribute"].description).toEqual(
97-
"upload a release binary"
97+
"upload a release binary and optionally distribute it to testers and run automated tests"
9898
);
9999
});
100100

101101
it("Should load 'appdistribution:testers:add' command", async () => {
102102
const firebaseCommands = onfireCLI._getFirebaseCommands();
103103
expect(firebaseCommands["appdistribution:testers:add"].description).toEqual(
104-
"add testers to project (and possibly group)"
104+
"add testers to project (and App Distribution group, if specified via flag)"
105105
);
106106
});
107107

108108
it("Should load 'appdistribution:testers:remove' command", async () => {
109109
const firebaseCommands = onfireCLI._getFirebaseCommands();
110110
expect(
111111
firebaseCommands["appdistribution:testers:remove"].description
112-
).toEqual("remove testers from a project (or group)");
112+
).toEqual(
113+
"remove testers from a project (or App Distribution group, if specified via flag)"
114+
);
113115
});
114116

115117
it("Should load 'exit' command", async () => {
@@ -147,6 +149,15 @@ describe("Run simple commands", () => {
147149
"--testers-file",
148150
"--groups",
149151
"--groups-file",
152+
"--test-devices",
153+
"--test-devices-file",
154+
"--test-username",
155+
"--test-password",
156+
"--test-password-file",
157+
"--test-username-resource",
158+
"--test-password-resource",
159+
"--test-case-ids",
160+
"--test-case-ids-file",
150161
"--project",
151162
]);
152163
});
@@ -471,20 +482,20 @@ describe("Test getting rendering list", () => {
471482
expect(renderMessage.length).toEqual(5);
472483
});
473484

474-
it("Should show that the selected command in index [0] is 'appdistribution:distribute -> upload a release binary'", () => {
485+
it("Should show that the selected command in index [0] is 'appdistribution:distribute -> upload a release binary and optionally distribute it to testers and run automated tests'", () => {
475486
const renderMessage = onfireCLI._getCommandsToRender();
476-
const cmdLabel = `-> upload a release binary`;
487+
const cmdLabel = `-> upload a release binary and optionally distribute it to testers and run automated tests`;
477488
expect(renderMessage[0]).toEqual(
478489
`${cli._textCyan(cli._textBold(">"))} ${cli._textGreen(
479490
cli._textBold("appdistribution:distribute")
480491
)} ${cli._textGreen(cmdLabel)}\x1b[K`
481492
);
482493
});
483494

484-
it("Should show that the unselected command in index [1] is 'appdistribution:testers:add -> add testers to project (and possibly group)'", () => {
495+
it("Should show that the unselected command in index [2] is 'appdistribution:testers:add -> add testers to project (and App Distribution group, if specified via flag)'", () => {
485496
const renderMessage = onfireCLI._getCommandsToRender();
486-
const cmdLabel = `-> add testers to project (and possibly group)`;
487-
expect(renderMessage[1]).toEqual(
497+
const cmdLabel = `-> add testers to project (and App Distribution group, if specified via flag)`;
498+
expect(renderMessage[2]).toEqual(
488499
` ${cli._textBold("appdistribution:testers:add")} ${cmdLabel}\x1b[K`
489500
);
490501
});
@@ -542,15 +553,6 @@ describe("Test getting rendering list", () => {
542553
)} ${cli._textGreen(cmdLabel)}\x1b[K`
543554
);
544555
});
545-
546-
it("Should show that the unselected option in index [1] is 'experimental:functions:shell -> launch full Node shell with emulated functions. (Alias for `firebase functions:shell.)'", () => {
547-
const renderMessage = onfireCLI._getCommandsToRender();
548-
const cmdLabel =
549-
"-> launch full Node shell with emulated functions. (Alias for `firebase functions:shell.)";
550-
expect(renderMessage[1]).toEqual(
551-
` ${cli._textBold("experimental:functions:shell")} ${cmdLabel}\x1b[K`
552-
);
553-
});
554556
});
555557
});
556558

0 commit comments

Comments
 (0)