Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Model.GetFooterVisibility function #152

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions table/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ func (m *Model) GetHeaderVisibility() bool {
return m.headerVisible
}

// GetFooterVisibility returns true if the footer has been set to
// visible (default) or false if the footer has been set to hidden.
// Note that even if the footer is visible it will only be rendered if
// it has contents.
func (m *Model) GetFooterVisibility() bool {
return m.footerVisible
}

// GetPaginationWrapping returns true if pagination wrapping is enabled, or false
// if disabled. If disabled, navigating through pages will stop at the first
// and last pages.
Expand Down
10 changes: 10 additions & 0 deletions table/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ func TestGetHeaderVisibility(t *testing.T) {
assert.False(t, model.GetHeaderVisibility(), "Header was not set to hidden")
}

func TestGetFooterVisibility(t *testing.T) {
model := New([]Column{})

assert.True(t, model.GetFooterVisibility(), "Footer should be visible by default")

model = model.WithFooterVisibility(false)

assert.False(t, model.GetFooterVisibility(), "Footer was not set to hidden")
}

func TestGetPaginationWrapping(t *testing.T) {
model := New([]Column{})

Expand Down
Loading