Skip to content

Commit

Permalink
feat(packages/sui-react-web-vitals): minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrés Alvarez authored and Andrés Alvarez committed Nov 24, 2023
1 parent 73478cc commit 55f1eaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/sui-react-web-vitals/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export default function WebVitalsReporter({
path: pathname,
target,
loadState: attribution.loadState,
visibilityState: document.visibilityState,
...(attribution.eventType && {eventType: attribution.eventType})
})
}
Expand Down
8 changes: 4 additions & 4 deletions packages/sui-react-web-vitals/test/browser/indexSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('WebVitalsReporter', () => {
await screen.findByRole('heading', {name: 'Title'})
})

it('should track cwv using logger callback', async () => {
it('should track cwv using callback', async () => {
const reporter = {
onINP: fn => {
fn({name: 'TTFB', value: 10})
Expand All @@ -49,7 +49,7 @@ describe('WebVitalsReporter', () => {
await waitFor(() => [expect(onReport.calledWithMatch({name: 'TTFB', amount: 10, pathname: '/'})).to.be.true])
})

it('should track cwv using logger callback with route id', async () => {
it('should track cwv using callback with route id', async () => {
const reporter = {
onINP: fn => {
fn({name: 'TTFB', value: 10})
Expand All @@ -67,7 +67,7 @@ describe('WebVitalsReporter', () => {
])
})

it('should track cwv using logger with browser', async () => {
it('should track cwv using callback with browser', async () => {
const reporter = {
onINP: fn => {
fn({name: 'TTFB', value: 10})
Expand All @@ -91,7 +91,7 @@ describe('WebVitalsReporter', () => {
])
})

it('should track cwv using logger with browser in context', async () => {
it('should track cwv using callback with browser in context', async () => {
const reporter = {
onINP: fn => {
fn({name: 'TTFB', value: 10})
Expand Down

0 comments on commit 55f1eaf

Please sign in to comment.