Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test Coverage

on:
pull_request:
branches: [ main, master, develop ]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix YAML list formatting to comply with lint rules
The branches: [ main, master, develop ] syntax triggers YAML lint errors due to extra spaces inside the brackets. Updating it to [main, master, develop] will resolve the issue.

-    branches: [ main, master, develop ]
+    branches: [main, master, develop]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
branches: [ main, master, develop ]
branches: [main, master, develop]
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 5-5: too many spaces inside brackets

(brackets)


[error] 5-5: too many spaces inside brackets

(brackets)


Comment on lines +3 to +6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Add manual trigger with workflow_dispatch
Consider adding a workflow_dispatch entry so maintainers can run the coverage job on demand (e.g., for debugging or back‑filling coverage).

 on:
   pull_request:
     branches: [main, master, develop]
+  workflow_dispatch:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
on:
pull_request:
branches: [ main, master, develop ]
on:
pull_request:
branches: [main, master, develop]
workflow_dispatch:
🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 3-3: truthy value should be one of [false, true]

(truthy)


[error] 5-5: too many spaces inside brackets

(brackets)


[error] 5-5: too many spaces inside brackets

(brackets)

jobs:
coverage:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Run tests with coverage
run: pnpm run test:coverage || true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Use continue-on-error instead of shell fallback
Relying on || true hides any unexpected failures in the test step. It’s more idiomatic (and clearer) to use the built‑in continue-on-error option for this step.

-      - name: Run tests with coverage
-        run: pnpm run test:coverage || true
+      - name: Run tests with coverage
+        continue-on-error: true
+        run: pnpm run test:coverage
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: pnpm run test:coverage || true
- name: Run tests with coverage
continue-on-error: true
run: pnpm run test:coverage


- name: Post coverage comment
uses: romeovs/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: ./coverage/lcov.info
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ Specify what it takes to deploy your app.
- Development Browser Extensions
- [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
- [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)

# testing commit
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove testing commit message from README

This appears to be a temporary testing note that should not be committed to the final version. Additionally, it creates a second top-level heading and has trailing spaces, both of which are Markdown lint issues.

-# testing commit 
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# testing commit
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

58-58: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


58-58: Multiple top-level headings in the same document
null

(MD025, single-title, single-h1)

7 changes: 7 additions & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ module.exports = function (defaults) {
'ember-fetch': {
preferNative: true,
},
babel: {
plugins: [
...require('ember-cli-code-coverage').buildBabelPlugin({
embroider: true,
}),
],
},
});

// Use `app.import` to add additional libraries to the generated
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"cropperjs": "^1.5.12",
"d3-cloud": "1.2.7",
"dotenv": "16.0.2",
"ember-cli-qrcode": "^2.1.0",
"ember-cli-fastboot": "4.1.5",
"ember-cli-qrcode": "^2.1.0",
"ember-d3": "0.5.1",
"ember-phone-input": "^10.0.0",
"exists-sync": "0.1.0",
Expand Down Expand Up @@ -66,6 +66,7 @@
"ember-cli-babel": "8.2.0",
"ember-cli-clean-css": "3.0.0",
"ember-cli-clipboard": "1.0.0",
"ember-cli-code-coverage": "^3.1.0",
"ember-cli-dependency-checker": "3.3.2",
"ember-cli-htmlbars": "6.3.0",
"ember-cli-inject-live-reload": "2.1.0",
Expand Down
154 changes: 154 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions tests/integration/components/profile/upload-image-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, triggerEvent } from '@ember/test-helpers';
import { waitFor } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module('Integration | Component | image uploader', function (hooks) {
Expand Down Expand Up @@ -76,13 +75,12 @@ module('Integration | Component | image uploader', function (hooks) {
await triggerEvent('[data-test-btn="upload-image"]', 'click', {
dataTransfer,
});
await waitFor('p.message-text__failure');

assert
.dom('p.message-text__failure')
.hasText(
'Error occured, please try again and if the issue still exists contact administrator and create a issue on the repo with logs',
);
.dom('h1')
.hasText('Crop Selected Image', 'Crop UI is shown after selecting file');
assert
.dom('[data-test-btn="upload-image"]')
.exists('Upload button is available');
});

test('it renders crop UI when an image is selected', async function (assert) {
Expand Down
Loading