Skip to content

Commit 6413d65

Browse files
committed
fix: stabilize procedures snapshots by sorting and update RecordsServer snapshots
1 parent 223ff6b commit 6413d65

2 files changed

Lines changed: 8288 additions & 8221 deletions

File tree

src/aux-records/RecordsServer.spec.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,15 @@ describe('RecordsServer', () => {
10581058
}
10591059

10601060
describe('GET /api/v2/procedures', () => {
1061+
function sortProceduresForSnapshot(body: any) {
1062+
return {
1063+
...body,
1064+
procedures: [...body.procedures].sort((a, b) =>
1065+
a.name.localeCompare(b.name)
1066+
),
1067+
};
1068+
}
1069+
10611070
it('should return the list of procedures', async () => {
10621071
const result = await server.handleHttpRequest(
10631072
httpGet('/api/v2/procedures', defaultHeaders)
@@ -1072,7 +1081,7 @@ describe('RecordsServer', () => {
10721081
headers: corsHeaders(defaultHeaders.origin),
10731082
});
10741083

1075-
expect(body).toMatchSnapshot();
1084+
expect(sortProceduresForSnapshot(body)).toMatchSnapshot();
10761085
});
10771086

10781087
it('should support procedures', async () => {
@@ -1089,7 +1098,7 @@ describe('RecordsServer', () => {
10891098
headers: corsHeaders(defaultHeaders.origin),
10901099
});
10911100

1092-
expect(body).toMatchSnapshot();
1101+
expect(sortProceduresForSnapshot(body)).toMatchSnapshot();
10931102
});
10941103

10951104
it('should include the recordName input schema for aiListChatModels', async () => {

0 commit comments

Comments
 (0)