This repository has been archived by the owner on Dec 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
facets.feature
110 lines (100 loc) · 3.04 KB
/
facets.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Feature: Facets
Scenario: List All Facets
Given the following indexed records
| name | age |
| John | 23 |
| John | 17 |
| Jack | 17 |
When I query for ""
Then I should have the following facets
| facet | option | count |
| Name | Jack | 1 |
| Name | John | 2 |
| Age | 17 | 2 |
| Age | 23 | 1 |
Scenario: List Matching Facets
Given the following indexed records
| name | age |
| John | 23 |
| John | 17 |
| Jack | 17 |
When I query for "John"
Then I should have the following facets
| facet | option | count |
| Age | 17 | 1 |
| Age | 23 | 1 |
Scenario: List Multiple Facets Applied to One Record
Given the following indexed records
| name |
| John, Jack |
| John |
| Joe, Jack |
When I query for ""
Then I should have the following facets
| facet | option | count |
| Name | Jack | 2 |
| Name | Joe | 1 |
| Name | John | 2 |
Scenario: Ignore Facets That Do Not Narrow Down List
Given the following indexed records
| name |
| John, Jack |
| John |
When I query for ""
Then I should have the following facets
| facet | option | count |
| Name | Jack | 1 |
Scenario: Query for One Facet
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query facets "9f33345"
Then I should find records named "Jane, Jack"
Scenario: Query for Two Facets
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query facets "9f33345-9a10ff2"
Then I should find records named "Jane"
Scenario: Query for Facets with Keywords
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query "Jane" with facets "9f33345"
Then I should find record named "Jane"
Scenario: List Applied Facets
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query facets "9f33345-9a10ff2"
Then I should have the following applied facets
| facet | option |
| Age | 17 |
| Name | Jane |
Scenario: Includes applied facets in facet params
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query facets "9f33345"
Then I should have the following facets
| facet | option | count | param |
| Name | Jack | 1 | 9f33345-bff6e04 |
| Name | Jane | 1 | 9f33345-9a10ff2 |
Scenario: Ignore non-matching facets
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query facets "bad-facet"
Then I should find 0 records