Fix tests for forming search object

This commit is contained in:
Angelina Filippova 2021-02-07 02:45:55 +03:00
parent 1189095675
commit 2d27962e16

View file

@ -61,6 +61,13 @@ describe('Form search object', () => {
key: ':terms_of_services', key: ':terms_of_services',
label: 'Terms of Services', label: 'Terms of Services',
search: ['Terms of Services', ':terms_of_services'] search: ['Terms of Services', ':terms_of_services']
},
{
groupKey: 'relays',
groupLabel: 'Relays',
key: ':relays',
label: 'Relays',
search: ['Relays', ':relays']
} }
] ]
expect(_.isEqual(formSearchObject(description), expected)).toBeTruthy() expect(_.isEqual(formSearchObject(description), expected)).toBeTruthy()
@ -109,6 +116,13 @@ describe('Form search object', () => {
key: ':terms_of_services', key: ':terms_of_services',
label: 'Terms of Services', label: 'Terms of Services',
search: ['Terms of Services', ':terms_of_services'] search: ['Terms of Services', ':terms_of_services']
},
{
groupKey: 'relays',
groupLabel: 'Relays',
key: ':relays',
label: 'Relays',
search: ['Relays', ':relays']
} }
] ]
expect(_.isEqual(formSearchObject(description), expected)).toBeTruthy() expect(_.isEqual(formSearchObject(description), expected)).toBeTruthy()
@ -157,6 +171,13 @@ describe('Form search object', () => {
key: ':terms_of_services', key: ':terms_of_services',
label: 'Terms of Services', label: 'Terms of Services',
search: ['Terms of Services', ':terms_of_services'] search: ['Terms of Services', ':terms_of_services']
},
{
groupKey: 'relays',
groupLabel: 'Relays',
key: ':relays',
label: 'Relays',
search: ['Relays', ':relays']
} }
] ]
expect(_.isEqual(formSearchObject(description), expected)).toBeTruthy() expect(_.isEqual(formSearchObject(description), expected)).toBeTruthy()
@ -173,7 +194,8 @@ describe('Form search object', () => {
label: "Admin token" } label: "Admin token" }
] ]
}] }]
const expected = [{ const expected = [
{
label: "Admin token", label: "Admin token",
key: ":admin_token", key: ":admin_token",
groupKey: ":pleroma", groupKey: ":pleroma",
@ -193,7 +215,15 @@ describe('Form search object', () => {
key: ':terms_of_services', key: ':terms_of_services',
label: 'Terms of Services', label: 'Terms of Services',
search: ['Terms of Services', ':terms_of_services'] search: ['Terms of Services', ':terms_of_services']
}] },
{
groupKey: 'relays',
groupLabel: 'Relays',
key: ':relays',
label: 'Relays',
search: ['Relays', ':relays']
}
]
expect(_.isEqual(formSearchObject(description), expected)).toBeTruthy() expect(_.isEqual(formSearchObject(description), expected)).toBeTruthy()
}) })
@ -269,12 +299,20 @@ describe('Form search object', () => {
key: ':instance_panel', key: ':instance_panel',
label: 'Instance Panel', label: 'Instance Panel',
search: ['Instance Panel', ':instance_panel'] search: ['Instance Panel', ':instance_panel']
}, { },
{
groupKey: ':terms_of_services', groupKey: ':terms_of_services',
groupLabel: 'Terms of Services', groupLabel: 'Terms of Services',
key: ':terms_of_services', key: ':terms_of_services',
label: 'Terms of Services', label: 'Terms of Services',
search: ['Terms of Services', ':terms_of_services'] search: ['Terms of Services', ':terms_of_services']
},
{
groupKey: 'relays',
groupLabel: 'Relays',
key: ':relays',
label: 'Relays',
search: ['Relays', ':relays']
} }
] ]
expect(_.isEqual(formSearchObject(description), expected)).toBeTruthy() expect(_.isEqual(formSearchObject(description), expected)).toBeTruthy()