Skip to content

Commit a727580

Browse files
committed
update test
1 parent 13d205a commit a727580

File tree

1 file changed

+5
-69
lines changed

1 file changed

+5
-69
lines changed

x-pack/test/apm_api_integration/trial/tests/csm/page_views.ts

Lines changed: 5 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,15 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext)
2020
);
2121

2222
expect(response.status).to.be(200);
23-
expect(response.body).to.eql({
24-
cls: '0',
25-
fid: '0.00',
26-
lcp: '0.00',
27-
tbt: '0.00',
28-
fcp: 0,
29-
lcpRanks: [0, 0, 100],
30-
fidRanks: [0, 0, 100],
31-
clsRanks: [0, 0, 100],
32-
});
23+
expectSnapshot(response.body).toMatch();
3324
});
3425
it('returns empty list with breakdowns', async () => {
3526
const response = await supertest.get(
3627
'/api/apm/rum-client/page-view-trends?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-14T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22elastic-co-rum-test%22%5D%7D&breakdowns=%7B%22name%22%3A%22Browser%22%2C%22fieldName%22%3A%22user_agent.name%22%2C%22type%22%3A%22category%22%7D'
3728
);
3829

3930
expect(response.status).to.be(200);
40-
expect(response.body).to.eql({
41-
cls: '0',
42-
fid: '0.00',
43-
lcp: '0.00',
44-
tbt: '0.00',
45-
fcp: 0,
46-
lcpRanks: [0, 0, 100],
47-
fidRanks: [0, 0, 100],
48-
clsRanks: [0, 0, 100],
49-
});
31+
expectSnapshot(response.body).toMatch();
5032
});
5133
});
5234

@@ -67,62 +49,16 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext)
6749

6850
expect(response.status).to.be(200);
6951

70-
expectSnapshot(response.body).toMatchInline(`
71-
Object {
72-
"cls": "0.00",
73-
"clsRanks": Array [
74-
100,
75-
0,
76-
0,
77-
],
78-
"fcp": 1072,
79-
"fid": "1.35",
80-
"fidRanks": Array [
81-
0,
82-
0,
83-
100,
84-
],
85-
"lcp": "1.27",
86-
"lcpRanks": Array [
87-
100,
88-
0,
89-
0,
90-
],
91-
"tbt": 0,
92-
}
93-
`);
52+
expectSnapshot(response.body).toMatch();
9453
});
95-
it('returns page views', async () => {
54+
it('returns page views with breakdown', async () => {
9655
const response = await supertest.get(
9756
'/api/apm/rum-client/page-view-trends?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-16T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22kibana-frontend-8_0_0%22%5D%7D&breakdowns=%7B%22name%22%3A%22Browser%22%2C%22fieldName%22%3A%22user_agent.name%22%2C%22type%22%3A%22category%22%7D'
9857
);
9958

10059
expect(response.status).to.be(200);
10160

102-
expectSnapshot(response.body).toMatchInline(`
103-
Object {
104-
"cls": "0.00",
105-
"clsRanks": Array [
106-
100,
107-
0,
108-
0,
109-
],
110-
"fcp": 1072,
111-
"fid": "1.35",
112-
"fidRanks": Array [
113-
0,
114-
0,
115-
100,
116-
],
117-
"lcp": "1.27",
118-
"lcpRanks": Array [
119-
100,
120-
0,
121-
0,
122-
],
123-
"tbt": 0,
124-
}
125-
`);
61+
expectSnapshot(response.body).toMatch();
12662
});
12763
});
12864
});

0 commit comments

Comments
 (0)