Skip to content

Commit

Permalink
fix prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarkilhed committed Jan 2, 2025
1 parent 11c2fe1 commit ee245e1
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions packages/scenes/src/behaviors/SceneRenderProfiler.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { calculateNetworkTime, processRecordedSpans } from "./SceneRenderProfiler";
import { calculateNetworkTime, processRecordedSpans } from './SceneRenderProfiler';

describe('calculateNetworkTime', () => {
it('should return the duration of a single request', () => {
const requests: PerformanceResourceTiming[] = [
{ startTime: 0, responseEnd: 100 } as PerformanceResourceTiming,
];
const requests: PerformanceResourceTiming[] = [{ startTime: 0, responseEnd: 100 } as PerformanceResourceTiming];
expect(calculateNetworkTime(requests)).toBe(100);
});

Expand Down Expand Up @@ -54,18 +52,18 @@ describe('calculateNetworkTime', () => {
});

describe('processRecordedSpans', () => {
it('should return the whole array if the last element is greater than 30', () => {
const spans = [10, 10, 40];
expect(processRecordedSpans(spans)).toEqual([10, 10, 40]);
});

it('should return up to the last element greater than 30', () => {
const spans = [10, 20, 30, 40, 60, 10];
expect(processRecordedSpans(spans)).toEqual([10, 20, 30, 40, 60]);
});

it('should return only the first element if all are below or equal to 30', () => {
const spans = [10, 20, 15, 5];
expect(processRecordedSpans(spans)).toEqual([10]);
});
it('should return the whole array if the last element is greater than 30', () => {
const spans = [10, 10, 40];
expect(processRecordedSpans(spans)).toEqual([10, 10, 40]);
});

it('should return up to the last element greater than 30', () => {
const spans = [10, 20, 30, 40, 60, 10];
expect(processRecordedSpans(spans)).toEqual([10, 20, 30, 40, 60]);
});

it('should return only the first element if all are below or equal to 30', () => {
const spans = [10, 20, 15, 5];
expect(processRecordedSpans(spans)).toEqual([10]);
});
});

0 comments on commit ee245e1

Please sign in to comment.