From a6a780d0d35227bf2fd72537a7012e04299541b0 Mon Sep 17 00:00:00 2001 From: ljuba_ch Date: Thu, 24 Apr 2025 17:56:41 +0300 Subject: [PATCH 1/5] added codesandbox --- src/sum.js | 2 +- src/sum.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sum.js b/src/sum.js index 506a413..db130c7 100644 --- a/src/sum.js +++ b/src/sum.js @@ -1,3 +1,3 @@ export function sum(a, b) { - return a + b; + return a - b; } diff --git a/src/sum.test.js b/src/sum.test.js index 1d4044a..6d483cd 100644 --- a/src/sum.test.js +++ b/src/sum.test.js @@ -2,6 +2,6 @@ import { sum } from './sum'; describe('sum', () => { it('return sum of two numbers', () => { - expect(sum(2, 3)).toEqual(5); + expect(sum(3, 2)).toEqual(1); }); }); From 9d7e160ea95c757daca42398e138ce866dd6f52e Mon Sep 17 00:00:00 2001 From: ljuba_ch Date: Thu, 24 Apr 2025 18:09:37 +0300 Subject: [PATCH 2/5] fix --- .github/workflows/codesandbox-link-comment.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/codesandbox-link-comment.yml b/.github/workflows/codesandbox-link-comment.yml index e0246ba..b0bfec7 100644 --- a/.github/workflows/codesandbox-link-comment.yml +++ b/.github/workflows/codesandbox-link-comment.yml @@ -1,11 +1,7 @@ name: Add codesandbox link on: - pull_request: - types: [opened] - # https://github.com/mshick/add-pr-comment/issues/25 - pull_request_target: - types: [opened] + pull_request jobs: codesandbox-comment: From 1cf752ded90a239f904b99a2f7c07a27cca172b7 Mon Sep 17 00:00:00 2001 From: ljuba_ch Date: Thu, 24 Apr 2025 18:17:06 +0300 Subject: [PATCH 3/5] fix 1.0 --- .github/workflows/codesandbox-link-comment.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codesandbox-link-comment.yml b/.github/workflows/codesandbox-link-comment.yml index b0bfec7..2389bdd 100644 --- a/.github/workflows/codesandbox-link-comment.yml +++ b/.github/workflows/codesandbox-link-comment.yml @@ -1,7 +1,8 @@ name: Add codesandbox link on: - pull_request + pull_request: + types: [opened] jobs: codesandbox-comment: @@ -14,4 +15,4 @@ jobs: with: message: | You can check this code at CodeSandbox with the link - https://githubbox.com/${{ github.repository }}/tree/${{ github.head_ref }} \ No newline at end of file + https://githubbox.com/${{ github.repository }}/tree/${{ github.head_ref }} From 67ea67ee863f7d6a6531b917428cd826cfd30f79 Mon Sep 17 00:00:00 2001 From: ljuba_ch Date: Thu, 24 Apr 2025 18:19:42 +0300 Subject: [PATCH 4/5] fix 1.1 --- .github/workflows/codesandbox-link-comment.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/codesandbox-link-comment.yml b/.github/workflows/codesandbox-link-comment.yml index 2389bdd..b7c5a91 100644 --- a/.github/workflows/codesandbox-link-comment.yml +++ b/.github/workflows/codesandbox-link-comment.yml @@ -3,6 +3,9 @@ name: Add codesandbox link on: pull_request: types: [opened] + # https://github.com/mshick/add-pr-comment/issues/25 + pull_request_target: + types: [opened] jobs: codesandbox-comment: From cb7210ea9ab03195cef982e1b5dda553888812fb Mon Sep 17 00:00:00 2001 From: ljuba_ch Date: Thu, 24 Apr 2025 18:29:31 +0300 Subject: [PATCH 5/5] fix 1.2 --- src/sum.js | 2 +- src/sum.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sum.js b/src/sum.js index db130c7..506a413 100644 --- a/src/sum.js +++ b/src/sum.js @@ -1,3 +1,3 @@ export function sum(a, b) { - return a - b; + return a + b; } diff --git a/src/sum.test.js b/src/sum.test.js index 6d483cd..225d85d 100644 --- a/src/sum.test.js +++ b/src/sum.test.js @@ -2,6 +2,6 @@ import { sum } from './sum'; describe('sum', () => { it('return sum of two numbers', () => { - expect(sum(3, 2)).toEqual(1); + expect(sum(3, 2)).toEqual(5); }); });