Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
afshinm committed Jan 9, 2024
1 parent 905f15c commit 835b31e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/view/plugin/search/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ export function Search() {
}, [props]);

useEffect(() => {
if (processor) {
config.pipeline.register<object, object>(processor);
}
if (!processor) return undefined;

config.pipeline.register<object, object>(processor);

return () => config.pipeline.unregister<object, object>(processor);
}, [config, processor]);
Expand Down
1 change: 1 addition & 0 deletions tests/jest/grid.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('Grid class', () => {

it('should trigger the events in the correct order', async () => {
const grid = new Grid({
processingThrottleMs: 0,
columns: ['a', 'b', 'c'],
data: [[1, 2, 3]],
});
Expand Down
4 changes: 4 additions & 0 deletions tests/jest/view/container.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('Container component', () => {

beforeEach(() => {
config = new Config().update({
processingThrottleMs: 0,
data: [
[1, 2, 3],
['a', 'b', 'c'],
Expand Down Expand Up @@ -244,6 +245,7 @@ describe('Container component', () => {

it('should render a container with array of objects without columns input', async () => {
const config = Config.fromPartialConfig({
processingThrottleMs: 0,
data: [
[1, 2, 3],
['a', 'b', 'c'],
Expand Down Expand Up @@ -285,6 +287,7 @@ describe('Container component', () => {

it('should render a container with array of objects with object columns', async () => {
const config = Config.fromPartialConfig({
processingThrottleMs: 0,
columns: [
{
name: 'Name',
Expand Down Expand Up @@ -341,6 +344,7 @@ describe('Container component', () => {

it('should unregister the processors', async () => {
const config = new Config().update({
processingThrottleMs: 0,
pagination: true,
search: true,
sort: true,
Expand Down

0 comments on commit 835b31e

Please sign in to comment.