Skip to content

Commit

Permalink
Fix snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv committed Jan 2, 2025
1 parent 38f7e88 commit 202b558
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/options/options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ describe('getOptions', () => {
maxNumber: 10,
multipleBranches: true,
multipleCommits: false,
noUnmergedBackportsHelp: false,
noVerify: true,
publishStatusCommentOnAbort: false,
publishStatusCommentOnFailure: false,
Expand Down
6 changes: 3 additions & 3 deletions src/test/e2e/cli/date-filters.private.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('date filters (dateSince, dateUntil)', () => {
);

expect(output).toMatchInlineSnapshot(`
"repo: backport-org/backport-e2e sourceBranch: master since: 2020-08-15T10:00:00.000Z until: 2020-08-15T10:30:00.000Z
"repo: backport-org/backport-e2e 🔹 sourceBranch: master 🔹 author: sorenlouv 🔹 since: 2020-08-15T10:00:00.000Z 🔹 until: 2020-08-15T10:30:00.000Z
? Select commit (Use arrow keys)
❯ 1. Bump to 8.0.0
Expand All @@ -42,7 +42,7 @@ describe('date filters (dateSince, dateUntil)', () => {
});

expect(outputWithoutPrFilter).toMatchInlineSnapshot(`
"repo: elastic/kibana sourceBranch: main autoMerge: true since: 2023-09-01T00:00:00.000Z until: 2023-10-01T00:00:00.000Z
"repo: elastic/kibana 🔹 sourceBranch: main 🔹 author: sorenlouv 🔹 autoMerge: true 🔹 since: 2023-09-01T00:00:00.000Z 🔹 until: 2023-10-01T00:00:00.000Z
? Select commit (Use arrow keys)
❯ 1. [APM] Add support for versioned APIs in diagnostics tool (#167050)
Expand All @@ -58,7 +58,7 @@ describe('date filters (dateSince, dateUntil)', () => {
);

expect(outputWithPrFilter).toMatchInlineSnapshot(`
"repo: elastic/kibana sourceBranch: main autoMerge: true since: 2023-09-01T00:00:00.000Z until: 2023-10-01T00:00:00.000Z
"repo: elastic/kibana 🔹 sourceBranch: main 🔹 author: sorenlouv 🔹 autoMerge: true 🔹 since: 2023-09-01T00:00:00.000Z 🔹 until: 2023-10-01T00:00:00.000Z
? Select commit (Use arrow keys)
❯ 1. [APM] Paginate big traces (#165584) 8.10"
Expand Down
6 changes: 3 additions & 3 deletions src/test/e2e/cli/different-merge-strategies.private.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('different-merge-strategies', () => {
);

expect(output).toMatchInlineSnapshot(`
"repo: backport-org/different-merge-strategies sourceBranch: main maxNumber: 20
"repo: backport-org/different-merge-strategies 🔹 sourceBranch: main 🔹 author: sorenlouv 🔹 maxNumber: 20
? Select commit (Use arrow keys)
❯ 1. Downsides with "Rebase and merge"
Expand Down Expand Up @@ -71,7 +71,7 @@ describe('different-merge-strategies', () => {
it('runs to completion without errors', () => {
expect(output).toMatchInlineSnapshot(`
"- Initializing...
repo: backport-org/different-merge-strategies sourceBranch: main pullNumber: 9
repo: backport-org/different-merge-strategies 🔹 sourceBranch: main 🔹 pullNumber: 9 🔹 author: sorenlouv
? Select pull request Merge pull request #9 from backport-org/many-merge-commits
✔ 100% Cloning repository from github.com (one-time operation)
Expand Down Expand Up @@ -191,7 +191,7 @@ View pull request: this-is-a-dry-run"
it('has the right output', async () => {
expect(output).toMatchInlineSnapshot(`
"- Initializing...
repo: backport-org/different-merge-strategies sourceBranch: main pullNumber: 9
repo: backport-org/different-merge-strategies 🔹 sourceBranch: main 🔹 pullNumber: 9 🔹 author: sorenlouv
? Select pull request Merge pull request #9 from backport-org/many-merge-commits
✔ 100% Cloning repository from github.com (one-time operation)
Expand Down
8 changes: 5 additions & 3 deletions src/test/e2e/cli/entrypoint.cli.private.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ Options:
authenticated user [string]
--repo, --upstream Repo owner and name [string]
--sha, --commit Commit sha to backport [string]
--noUnmergedBackportsHelp Do not list the unmerged backports in PR
comment [boolean]
--sourceBranch Specify a non-default branch (normally
"master") to backport from [string]
--sourcePRLabel, --sourcePrLabel Add labels to the source (original) PR [array]
Expand Down Expand Up @@ -150,7 +152,7 @@ Or contact me directly: "
);

expect(output).toMatchInlineSnapshot(`
"repo: backport-org/backport-e2e sourceBranch: master
"repo: backport-org/backport-e2e 🔹 sourceBranch: master 🔹 author: sorenlouv
? Select commit (Use arrow keys)
❯ 1. Add sheep emoji (#9) 7.8
Expand Down Expand Up @@ -179,7 +181,7 @@ Or contact me directly: "
);

expect(output).toMatchInlineSnapshot(`
"repo: backport-org/backport-e2e sourceBranch: master maxNumber: 6
"repo: backport-org/backport-e2e 🔹 sourceBranch: master 🔹 author: sorenlouv 🔹 maxNumber: 6
? Select commit (Use arrow keys)
❯ 1. Add sheep emoji (#9) 7.8
Expand All @@ -205,7 +207,7 @@ Or contact me directly: "
);

expect(output).toMatchInlineSnapshot(`
"repo: backport-org/backport-e2e sourceBranch: 7.x maxNumber: 6
"repo: backport-org/backport-e2e 🔹 sourceBranch: 7.x 🔹 author: sorenlouv 🔹 maxNumber: 6
? Select commit (Use arrow keys)
❯ 1. Add 🍏 emoji (#5) (#6)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('interactive error handling', () => {
stringAfter: '<BACKPORT_DIR>',
}),
).toMatchInlineSnapshot(`
"repo: backport-org/repo-with-conflicts sourceBranch: main pullNumber: 12
"repo: backport-org/repo-with-conflicts 🔹 sourceBranch: main 🔹 pullNumber: 12 🔹 author: sorenlouv
Backporting to 7.x:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('gracefully handle corrupted repo', () => {
// second run: backport should re-create remotes and branches correctly
expect(output).toMatchInlineSnapshot(`
"- Initializing...
repo: backport-org/integration-test sourceBranch: master
repo: backport-org/integration-test 🔹 sourceBranch: master 🔹 sha: 16cfd987b82f49a79ebc663506f5d215b7a81c5c 🔹 author: sorenlouv
? Select commit Bump to 8.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('repo-with-backportrc-removed (missing .backportrc.json config file)',
);

expect(output).toMatchInlineSnapshot(`
"repo: backport-org/repo-with-backportrc-removed sourceBranch: main
"repo: backport-org/repo-with-backportrc-removed 🔹 sourceBranch: main 🔹 author: sorenlouv
? Select commit (Use arrow keys)
❯ 1. Rename README.me to README.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('backport-org/repo-with-changing-branchLabelMapping', () => {
);

expect(output).toMatchInlineSnapshot(`
"repo: backport-org/repo-with-changing-branchLabelMapping sourceBranch: main pullNumber: 6
"repo: backport-org/repo-with-changing-branchLabelMapping 🔹 sourceBranch: main 🔹 pullNumber: 6 🔹 author: sorenlouv
? Select branch (Press <space> to select, <a> to toggle all, <i> to invert
selection, and <enter> to proceed)
Expand Down
4 changes: 2 additions & 2 deletions src/test/e2e/cli/test-that-repo-can-be-cloned.private.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('test-that-repo-can-be-cloned', () => {
expect(output).toContain('Cloning repository from github.com');
expect(output).toMatchInlineSnapshot(`
"- Initializing...
repo: backport-org/test-that-repo-can-be-cloned sourceBranch: main pullNumber: 1
repo: backport-org/test-that-repo-can-be-cloned 🔹 sourceBranch: main 🔹 pullNumber: 1 🔹 author: sorenlouv
? Select pull request Beginning of a beautiful repo (#1)
✔ 100% Cloning repository from github.com (one-time operation)
Expand All @@ -56,7 +56,7 @@ View pull request: this-is-a-dry-run"
expect(output).not.toContain('Cloning repository from github.com');
expect(output).toMatchInlineSnapshot(`
"- Initializing...
repo: backport-org/test-that-repo-can-be-cloned sourceBranch: main pullNumber: 1
repo: backport-org/test-that-repo-can-be-cloned 🔹 sourceBranch: main 🔹 pullNumber: 1 🔹 author: sorenlouv
? Select pull request Beginning of a beautiful repo (#1)
Expand Down

0 comments on commit 202b558

Please sign in to comment.