-
-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1412 from grid-js/fix-search
Fix deepEqual helper function
- Loading branch information
Showing
6 changed files
with
100 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
export default { | ||
search: { | ||
placeholder: 'Sök...', | ||
}, | ||
sort: { | ||
sortAsc: 'Sortera kolumn stigande', | ||
sortDesc: 'Sortera kolumn fallande', | ||
}, | ||
pagination: { | ||
previous: 'Föregående', | ||
next: 'Nästa', | ||
navigate: (page, pages) => `Sida ${page} av ${pages}`, | ||
page: (page) => `Sida ${page}`, | ||
showing: 'Visar', | ||
of: 'av', | ||
to: 'till', | ||
results: 'resultat', | ||
}, | ||
loading: 'Laddar...', | ||
noRecordsFound: 'Inga matchande poster hittades', | ||
error: 'Ett fel uppstod vid hämtning av data', | ||
}; | ||
search: { | ||
placeholder: 'Sök...', | ||
}, | ||
sort: { | ||
sortAsc: 'Sortera kolumn stigande', | ||
sortDesc: 'Sortera kolumn fallande', | ||
}, | ||
pagination: { | ||
previous: 'Föregående', | ||
next: 'Nästa', | ||
navigate: (page, pages) => `Sida ${page} av ${pages}`, | ||
page: (page) => `Sida ${page}`, | ||
showing: 'Visar', | ||
of: 'av', | ||
to: 'till', | ||
results: 'resultat', | ||
}, | ||
loading: 'Laddar...', | ||
noRecordsFound: 'Inga matchande poster hittades', | ||
error: 'Ett fel uppstod vid hämtning av data', | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "gridjs", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"description": "Advanced table plugin", | ||
"author": "Afshin Mehrabani <[email protected]>", | ||
"license": "MIT", | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { deepEqual } from '../../../src/util/deepEqual'; | ||
|
||
describe('deepEqual', () => { | ||
it('should return true when objects are the same', () => { | ||
const result = deepEqual({ a: 42 }, { a: 42 }); | ||
expect(result).toBeTrue(); | ||
}); | ||
|
||
it('should return false when objects are not the same', () => { | ||
const result = deepEqual({ b: 42 }, { a: 42 }); | ||
expect(result).toBeFalse(); | ||
}); | ||
|
||
it('should return true when nested objects are the same', () => { | ||
const result = deepEqual({ a: 42, c: { a: 24 } }, { a: 42, c: { a: 24 } }); | ||
expect(result).toBeTrue(); | ||
}); | ||
|
||
it('should return false when nested objects not are the same', () => { | ||
const result = deepEqual({ a: 42, c: { x: 24 } }, { a: 42, c: { a: 24 } }); | ||
expect(result).toBeFalse(); | ||
}); | ||
|
||
it('should return false when objects have functions', () => { | ||
const result = deepEqual({ a: 42, c: jest.fn() }, { a: 42, c: jest.fn() }); | ||
expect(result).toBeFalse(); | ||
}); | ||
|
||
it('should return true when objects have same functions', () => { | ||
const fn = jest.fn(); | ||
const result = deepEqual({ a: 42, c: fn }, { a: 42, c: fn }); | ||
expect(result).toBeTrue(); | ||
}); | ||
}); |