From 051ba6322da83b85873ce125567f371a418c4dcc Mon Sep 17 00:00:00 2001 From: annbisha Date: Thu, 23 Apr 2026 13:29:31 +0300 Subject: [PATCH 1/2] d --- .github/workflows/test.yml-template | 29 +++++++++++++++++++++++++++++ src/scripts/main.js | 15 ++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml-template diff --git a/.github/workflows/test.yml-template b/.github/workflows/test.yml-template new file mode 100644 index 00000000..44ac4e96 --- /dev/null +++ b/.github/workflows/test.yml-template @@ -0,0 +1,29 @@ +name: Test + +on: + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm start & sleep 5 && npm test + - name: Upload tests report(cypress mochaawesome merged HTML report) + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + name: report + path: reports diff --git a/src/scripts/main.js b/src/scripts/main.js index 2cdcd10c..db53bc49 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -21,7 +21,20 @@ const food = { const tree = document.querySelector('#tree'); function createTree(element, data) { - // WRITE YOUR CODE HERE + const some = document.createElement('ul'); + + for (const key in data) { + const someTwo = document.createElement('li'); + + some.append(someTwo); + someTwo.textContent = key; + + if (Object.keys(data[key]).length > 0) { + createTree(someTwo, data[key]); + } + } + + element.append(some); } createTree(tree, food); From 627b68434075c82387082f0b42daadf4657408a5 Mon Sep 17 00:00:00 2001 From: annbisha Date: Thu, 23 Apr 2026 15:04:15 +0300 Subject: [PATCH 2/2] d --- src/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.html b/src/index.html index 3496ee13..17cc8917 100644 --- a/src/index.html +++ b/src/index.html @@ -9,6 +9,7 @@ /> +