File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,15 @@ import { app } from './utils'
3
3
4
4
test ( 'list column privileges' , async ( ) => {
5
5
const res = await app . inject ( { method : 'GET' , path : '/column-privileges' } )
6
- expect (
7
- res
8
- . json < PostgresColumnPrivileges [ ] > ( )
9
- . find (
10
- ( { relation_schema, relation_name, column_name } ) =>
11
- relation_schema === 'public' && relation_name === 'todos' && column_name === 'id'
12
- )
13
- ) . toMatchInlineSnapshot (
6
+ const column = res
7
+ . json < PostgresColumnPrivileges [ ] > ( )
8
+ . find (
9
+ ( { relation_schema, relation_name, column_name } ) =>
10
+ relation_schema === 'public' && relation_name === 'todos' && column_name === 'id'
11
+ ) !
12
+ // We don't guarantee order of privileges, but we want to keep the snapshots consistent.
13
+ column . privileges . sort ( ( a , b ) => JSON . stringify ( a ) . localeCompare ( JSON . stringify ( b ) ) )
14
+ expect ( column ) . toMatchInlineSnapshot (
14
15
{ column_id : expect . stringMatching ( / ^ \d + \. \d + $ / ) } ,
15
16
`
16
17
{
You can’t perform that action at this time.
0 commit comments