[deploy] Return boolean value instead of undefined for listings open modal (#7854)

* Return a boolean value not undefined

* Fix typo
This commit is contained in:
Andy Zhao 2020-05-14 13:10:55 -04:00 committed by GitHub
parent d1e39a7dba
commit 22cdbcbd38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -20,7 +20,7 @@ const firstListing = {
},
};
const secondtListing = {
const secondListing = {
id: 21,
category: 'misc',
location: 'West Refugio',
@ -56,7 +56,7 @@ const thirdListing = {
},
};
const listings = [firstListing, secondtListing, thirdListing];
const listings = [firstListing, secondListing, thirdListing];
const getProps = () => ({
listings,

View file

@ -20,7 +20,7 @@ describe('updateListings', () => {
},
};
const secondtListing = {
const secondListing = {
id: 21,
category: 'misc',
location: 'West Refugio',
@ -57,10 +57,10 @@ describe('updateListings', () => {
},
};
const classifiedListings = [firstListing, secondtListing, thirdListing];
const classifiedListings = [firstListing, secondListing, thirdListing];
test('Should update the listings', () => {
const result = updateListings(classifiedListings);
const expectedResult = [firstListing, secondtListing];
const expectedResult = [firstListing, secondListing];
expect(result).toEqual(expectedResult);
});

View file

@ -282,7 +282,8 @@ export class Listings extends Component {
message,
} = this.state;
const shouldRenderModal = openedListing != null && undefined;
const shouldRenderModal =
openedListing !== null && openedListing !== undefined;
if (initialFetch) {
this.triggerMasonry();