nilsbu / lastfm

Last.FM tools in Go
1 stars 0 forks source link

tables HTML needs headers with dates #11

Open github-actions[bot] opened 2 years ago

github-actions[bot] commented 2 years ago

https://github.com/nilsbu/lastfm/blob/e3293b698c21984b40d765bcd3fa9c84d2487b5b/pkg/format/table_test.go#L133


func TestTableHTML(t *testing.T) {
    cases := []struct {
        charts charts.Charts
        ranges charts.Ranges
        ok     bool
        str    string
    }{
        {
            charts.FromMap(map[string][]float64{}),
            trustRanges("1d", rsrc.ParseDay("2012-01-01"), 1),
            true,
            "<table></table>",
        },
        { // TODO tables HTML needs headers with dates
            charts.FromMap(map[string][]float64{
                "A": {1.33, 4, 7},
            }),
            trustRanges("3d", rsrc.ParseDay("2012-01-01"), 8),
            true,
            "<table><tr><td>A</td><td>1.33</td><td>4</td><td>7</td></tr></table>",
        },
    }