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

Fixes footers and captions disappearing on empty tables #352

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

SandroHc
Copy link
Contributor

Custom table footers and captions were not being rendered on empty tables. The snippet bellow will render a datatable without the <caption> and <tfoot>.

This was my first time using Mocha. Please let me know if there's a better way to write the tests.

<table>
    <caption>This is a table caption.</caption>
    <thead>
        <tr>
            <th>Header 1</th>
            <th>Header 2</th>
        </tr>
    </thead>
    <tbody>
        <!-- No data! -->
    </tbody>
    <tfoot>
        <tr>
            <td colspan="2">
                This is a table footer.
            </td>
        </tr>
    </tfoot>
</table>
<script>
    new window.simpleDatatables.DataTable("table")
</script>

Custom table footers and captions were not being rendered on empty tables.

```html
<table>
    <caption>This is a table caption.</caption>
    <thead>
        <tr>
            <th>Header 1</th>
            <th>Header 2</th>
        </tr>
    </thead>
    <tbody>
        <!-- No data! -->
    </tbody>
    <tfoot>
        <tr>
            <td colspan="2">
                This is a table footer.
            </td>
        </tr>
    </tfoot>
</table>
<script>
    new window.simpleDatatables.DataTable("table")
</script>
```
@johanneswilm
Copy link
Member

Mocha usage looks fine to me @SandroHc . We don't need to use it if you want to migrate the tests to something else. I just picked a framework that was popular at the time, if I recall correctly.

@johanneswilm johanneswilm merged commit 7f18d33 into fiduswriter:main Nov 22, 2023
2 checks passed
@SandroHc
Copy link
Contributor Author

Mocha is fine by me. It's the perfect opportunity for me to learn it!

@SandroHc SandroHc deleted the missing-footers branch November 23, 2023 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants