Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
duncan-thacker committed Mar 1, 2019
1 parent a3685e6 commit 154f6a5
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/__snapshots__/cache.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ exports[`MultiPicker component uses global cache if configured 1`] = `
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -502,6 +503,7 @@ exports[`MultiPicker component uses global cache if configured 1`] = `
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand All @@ -512,6 +514,7 @@ exports[`MultiPicker component uses global cache if configured 1`] = `
className="MuiPaper-root MuiPaper-elevation2"
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down
6 changes: 6 additions & 0 deletions src/__snapshots__/customisation.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2930,6 +2930,7 @@ exports[`MultiPicker component renders custom suggestion components 1`] = `
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -2973,6 +2974,7 @@ exports[`MultiPicker component renders custom suggestion components 1`] = `
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand All @@ -2983,6 +2985,7 @@ exports[`MultiPicker component renders custom suggestion components 1`] = `
className="MuiPaper-root MuiPaper-elevation2"
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -3840,6 +3843,7 @@ exports[`MultiPicker component shows an custom error message if the user provide
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -3883,6 +3887,7 @@ exports[`MultiPicker component shows an custom error message if the user provide
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand All @@ -3893,6 +3898,7 @@ exports[`MultiPicker component shows an custom error message if the user provide
className="MuiPaper-root MuiPaper-elevation2"
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down
21 changes: 21 additions & 0 deletions src/__snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,7 @@ exports[`MultiPicker component does not show suggestion items that have already
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -1477,6 +1478,7 @@ exports[`MultiPicker component does not show suggestion items that have already
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand All @@ -1487,6 +1489,7 @@ exports[`MultiPicker component does not show suggestion items that have already
className="MuiPaper-root MuiPaper-elevation2"
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -2716,6 +2719,7 @@ exports[`MultiPicker component renders dropdown when typing 1`] = `
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -2759,6 +2763,7 @@ exports[`MultiPicker component renders dropdown when typing 1`] = `
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand All @@ -2769,6 +2774,7 @@ exports[`MultiPicker component renders dropdown when typing 1`] = `
className="MuiPaper-root MuiPaper-elevation2"
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -5152,6 +5158,7 @@ exports[`MultiPicker component shows a 'no suggestions found' message if the get
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -5195,6 +5202,7 @@ exports[`MultiPicker component shows a 'no suggestions found' message if the get
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand All @@ -5205,6 +5213,7 @@ exports[`MultiPicker component shows a 'no suggestions found' message if the get
className="MuiPaper-root MuiPaper-elevation2"
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -6183,6 +6192,7 @@ exports[`MultiPicker component shows a 'type more characters' message if the get
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -6226,6 +6236,7 @@ exports[`MultiPicker component shows a 'type more characters' message if the get
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand All @@ -6236,6 +6247,7 @@ exports[`MultiPicker component shows a 'type more characters' message if the get
className="MuiPaper-root MuiPaper-elevation2"
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -7209,6 +7221,7 @@ exports[`MultiPicker component shows a loading message if the suggestions are be
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -7252,6 +7265,7 @@ exports[`MultiPicker component shows a loading message if the suggestions are be
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand All @@ -7262,6 +7276,7 @@ exports[`MultiPicker component shows a loading message if the suggestions are be
className="MuiPaper-root MuiPaper-elevation2"
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -8282,6 +8297,7 @@ exports[`MultiPicker component shows an error message if the getSuggestions func
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -8325,6 +8341,7 @@ exports[`MultiPicker component shows an error message if the getSuggestions func
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand All @@ -8335,6 +8352,7 @@ exports[`MultiPicker component shows an error message if the getSuggestions func
className="MuiPaper-root MuiPaper-elevation2"
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -9321,6 +9339,7 @@ exports[`MultiPicker component shows an error message if the getSuggestions func
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down Expand Up @@ -9364,6 +9383,7 @@ exports[`MultiPicker component shows an error message if the getSuggestions func
square={true}
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand All @@ -9374,6 +9394,7 @@ exports[`MultiPicker component shows an error message if the getSuggestions func
className="MuiPaper-root MuiPaper-elevation2"
style={
Object {
"overflowY": "auto",
"position": "absolute",
"width": "100%",
"zIndex": 20,
Expand Down
17 changes: 17 additions & 0 deletions src/customisation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,21 @@ describe("MultiPicker component", () => {
expect(wrapper.find(Chip)).toHaveProp("variant", "outlined");
});


it("applies the 'maxDropdownHeight' prop to the dropdown", async () => {
expect.assertions(1);

const baseProps = {
itemToString: item => item,
value: [],
onChange: NOOP,
getSuggestedItems: () => [],
maxDropdownHeight: 100
};
const wrapper = mountStable(<MultiPicker { ...baseProps } />);
await changeInputValueAndUpdate(wrapper, "some text");

expect(wrapper.find(Paper)).toHaveStyle("maxHeight", 100);
});

});

0 comments on commit 154f6a5

Please sign in to comment.