Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: test cases #16860

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mayuran-deriv
Copy link
Contributor

@mayuran-deriv mayuran-deriv commented Sep 16, 2024

Screenshot 2024-09-17 at 6 57 23 PM

Copy link

vercel bot commented Sep 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Sep 19, 2024 7:36am

Copy link
Contributor

github-actions bot commented Sep 16, 2024

A production App ID was automatically generated for this PR. (log)

Click here to copy & paste above information.
- **PR**: [https://github.com/binary-com/deriv-app/pull/16860](https://github.com/binary-com/deriv-app/pull/16860)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-mayuran-deriv-mayuran-utils-test-case.binary.sx?qa_server=red.derivws.com&app_id=23811
    - **Original**: https://deriv-app-git-fork-mayuran-deriv-mayuran-utils-test-case.binary.sx
- **App ID**: `23811`

Copy link
Contributor

github-actions bot commented Sep 16, 2024

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 27
🟧 Accessibility 70
🟢 Best practices 92
🟧 SEO 77
🟧 PWA 78

Lighthouse ran with https://deriv-app-git-fork-mayuran-deriv-mayuran-utils-test-case.binary.sx/

@coveralls
Copy link

coveralls commented Sep 16, 2024

Coverage Status

coverage: 48.667% (-3.6%) from 52.24%
when pulling bf3210f on mayuran-deriv:mayuran/utils-test-case
into 6bc18c3 on binary-com:master.

Copy link

sonarcloud bot commented Sep 19, 2024

Copy link
Contributor

Generating Lighthouse report...

@@ -20,7 +20,7 @@ export const addDynamicBlockToDOM = (
shadow_block.appendChild(field_block);
block.appendChild(shadow_block);

const amount_block = strategy_dom.querySelector('value[name="AMOUNT"]');
const amount_block = strategy_dom?.querySelector('value[name="AMOUNT"]');
Copy link
Contributor

Choose a reason for hiding this comment

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

@mayuran-deriv is it necessary to use optional chaining here? strategy_dom is a required argument. If this one is not passed, the next lines (from lines 24 to 29) will not be covered.

Comment on lines +5 to +15
jest.mock('@deriv/translations', () => ({
localize: jest.fn((message, values) => {
let result = message;
if (values) {
Object.keys(values).forEach(key => {
result = result.replace(`{{${key}}}`, values[key]);
});
}
return result;
}),
}));
Copy link
Contributor

Choose a reason for hiding this comment

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

@mayuran-deriv do we need to mock @deriv/translations? There is a global mock for this in here <root>/__mocks__/translation.mock.js. Doesn't it work from there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants