This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from "react"; | |
| import { | |
| AnyComponent, | |
| BaseObject, | |
| ExecutionProps, | |
| Interpolation, | |
| KnownTarget, | |
| NoInfer, | |
| RuleSet, | |
| Styles, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, | |
| sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; | |
| font-size: 16px; | |
| line-height: 1.5; | |
| word-wrap: break-word; | |
| color: #24292e; | |
| background-color: #fff; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('should work in controlled mode', () => { | |
| class ControlledUsage extends React.Component<{}, { counter: number, open: boolean }> { | |
| constructor(props) { | |
| super(props); | |
| this.toggle = this.toggle.bind(this); | |
| } | |
| state = { | |
| counter: 0, | |
| open: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('should work when value is controlled but changes are ignored (readonly mode)', () => { | |
| const { clickHeader, isOpen } = mountUsage(<Zippy header={'header'} open={true}/>); | |
| expect(isOpen()).toEqual(true); | |
| clickHeader(); | |
| expect(isOpen()).toEqual(true); | |
| clickHeader(); | |
| expect(isOpen()).toEqual(true); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('should handle uncontrolled value and change callback', () => { | |
| const onToggleSpy = jest.fn(); | |
| const { clickHeader } = mountUsage(<Zippy header={'header'} onToggle={onToggleSpy}/>); | |
| clickHeader(); | |
| expect(onToggleSpy).toBeCalledWith(true); | |
| clickHeader(); | |
| expect(onToggleSpy).toBeCalledWith(false); | |
| expect(onToggleSpy).toHaveBeenCalledTimes(2); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('should work when neither open state is controlled nor toggle handler is passed', () => { | |
| const { clickHeader, isOpen } = mountUsage(); | |
| expect(isOpen()).toBe(false); | |
| clickHeader(); | |
| expect(isOpen()).toBe(true); | |
| clickHeader(); | |
| expect(isOpen()).toBe(false); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mountUsage(usage = <Zippy header='header'/>) { | |
| const wrapper = mount(usage); | |
| return { | |
| wrapper, | |
| isOpen: () => wrapper.find('.zippy-content').length > 0, | |
| clickHeader: () => wrapper.find('.zippy-header').simulate('click'), | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface UsageProps { | |
| value?: number; | |
| changeHandler?: (value: number) => number | void; | |
| } | |
| function Counter({value, changeHandler}: UsageProps) { | |
| const [valueState, setValue] = useControllableState(value, changeHandler, 0); | |
| return <div> | |
| <span className="value">{valueState}</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name jira rtl fix | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description fixes rtl issues in jira | |
| // @author Alireza Mirian | |
| // @include /^https?://jira\..*$/ | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| 'use strict'; | |
| /** | |
| * This monkey-patch for the dropdownService enables to nest dropdowns. | |
| * Issue: https://github.com/angular-ui/bootstrap/issues/2421 | |
| * PR: https://github.com/angular-ui/bootstrap/pull/3776 | |
| */ |
NewerOlder