Skip to content

Commit

Permalink
fix(pencil): Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
larowlan committed Jul 15, 2020
1 parent 57f3b31 commit 2460dac
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ export default { Accordion };

```javascript
// __tests__/accordion.js
import { render, fireEvent } from 'twig-testing-library'
import { render, fireEvent, Twig } from 'twig-testing-library'

// Add Twig extensions - see the Twig.js wiki.
Twig.extendFilter("backwords", function(value) {
return value.split(" ").reverse().join(" ");
});

describe('Accordion toggling', () => {
it('Can be rendered open, and then collapsed on click', async () => {
Expand All @@ -140,14 +145,7 @@ describe('Accordion toggling', () => {
// Namespace support
{
'my_namespace': './some/path'
},
// Support twig extensions via a callback.
(Twig) => {
Twig.extendFilter("backwords", function(value) {
return value.split(" ").reverse().join(" ");
});
}
);
});
const accordionElement = container.querySelector('.accordion');
const accordion = new Accordion.Accordion(accordionElement);
accordion.init();
Expand Down

0 comments on commit 2460dac

Please sign in to comment.