(t *testing.T)
| 30 | ) |
| 31 | |
| 32 | func TestListFeatures(t *testing.T) { |
| 33 | testCases := []struct { |
| 34 | name string |
| 35 | mockConfig *MockFeaturesSearchConfig |
| 36 | expectedCallCount int // For the mock method |
| 37 | expectedCacheCalls []*ExpectedCacheCall |
| 38 | expectedGetCalls []*ExpectedGetCall |
| 39 | request *http.Request |
| 40 | expectedResponse *http.Response |
| 41 | }{ |
| 42 | { |
| 43 | name: "Success Case - no optional params - use defaults", |
| 44 | mockConfig: &MockFeaturesSearchConfig{ |
| 45 | expectedPageToken: nil, |
| 46 | expectedPageSize: 100, |
| 47 | expectedSearchNode: nil, |
| 48 | expectedSortBy: nil, |
| 49 | expectedWPTMetricView: backend.TestCounts, |
| 50 | expectedBrowsers: []backend.BrowserPathParam{ |
| 51 | backend.Chrome, |
| 52 | backend.Edge, |
| 53 | backend.Firefox, |
| 54 | backend.Safari, |
| 55 | backend.ChromeAndroid, |
| 56 | backend.FirefoxAndroid, |
| 57 | backend.SafariIos, |
| 58 | }, |
| 59 | page: &backend.FeaturePage{ |
| 60 | Metadata: backend.PageMetadataWithTotal{ |
| 61 | NextPageToken: nil, |
| 62 | Total: 100, |
| 63 | }, |
| 64 | Data: []backend.Feature{ |
| 65 | { |
| 66 | Baseline: &backend.BaselineInfo{ |
| 67 | Status: new(backend.Widely), |
| 68 | LowDate: new( |
| 69 | openapi_types.Date{Time: time.Date(2000, time.January, 1, 0, 0, 0, 0, time.UTC)}, |
| 70 | ), |
| 71 | HighDate: new( |
| 72 | openapi_types.Date{Time: time.Date(2001, time.January, 1, 0, 0, 0, 0, time.UTC)}, |
| 73 | ), |
| 74 | }, |
| 75 | FeatureId: "feature1", |
| 76 | Name: "feature 1", |
| 77 | Spec: nil, |
| 78 | Usage: nil, |
| 79 | Wpt: nil, |
| 80 | BrowserImplementations: &map[string]backend.BrowserImplementation{ |
| 81 | "browser1": { |
| 82 | Status: new(backend.Available), |
| 83 | Date: nil, |
| 84 | Version: new("101"), |
| 85 | }, |
| 86 | }, |
| 87 | DeveloperSignals: nil, |
| 88 | Discouraged: nil, |
| 89 | VendorPositions: nil, |
nothing calls this directly
no test coverage detected