Skip to content

Commit

Permalink
refactor: update exports
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Dec 14, 2023
1 parent ffa418f commit 9fcbfbb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
File renamed without changes.
12 changes: 8 additions & 4 deletions packages/blade/docs/utils/coverge.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { Meta } from '@storybook/addon-docs';

<Meta title="Utils/coverage" />
<Meta title="Utils/Blade Coverage" />

> **Note:** These functions are designed for web applications and should be used in a browser environment.
# Blade Coverage Utils

Blade coverage measures the percentage of blade nodes in a webpage's total DOM nodes. Apps at Razorpay must maintain a minimum blade coverage of 70%. Verify your app's coverage on the [Blade Coverage Dashboard](https://app.amplitude.com/analytics/razorpay-mobile/dashboard/texx2y4).

Blade provides the following utils to help you calculate & test the coverage on a webpage. These functions are designed for web applications and should be used in a browser environment.

## `assertBladeCoverage`

Expand All @@ -20,7 +24,7 @@ Parameters:

```js dark
import { test, expect } from '@playwright/test';
import { assertBladeCoverage } from '@razorpay/blade/coverage';
import { assertBladeCoverage } from '@razorpay/blade/coverageUtils';

test.describe.parallel('Test Home @flow=home', () => {
test('should have blade coverage more than 70% @priority=normal', async ({ page }) => {
Expand All @@ -46,7 +50,7 @@ Parameters:
This utility function calculates the blade usage coverage in percentage of the DOM elements on a web page.
```js dark
import { getBladeCoverage } from '@razorpay/blade/coverage';
import { getBladeCoverage } from '@razorpay/blade/coverageUtils';
const { bladeCoverage, totalNodes, bladeNodes } = getBladeCoverage();
```
Expand Down
4 changes: 2 additions & 2 deletions packages/blade/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
"default": "./build/lib/web/production/utils/index.js"
}
},
"./coverage": {
"./coverageUtils": {
"default": {
"types": "./coverage.d.ts",
"types": "./coverageUtils.d.ts",
"default": "./build/lib/web/production/utils/bladeCoverage.js"
}
}
Expand Down

0 comments on commit 9fcbfbb

Please sign in to comment.