Skip to content

Commit

Permalink
Update elasticsearch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fdelavega committed Apr 27, 2020
1 parent bd869b4 commit 7a6694e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions test/lib/elastic_indexes.js
Expand Up @@ -177,7 +177,6 @@ describe("Elasticsearch indexes tests", function () {
}
}, {
index: 'offerings',
type: 'offerings',
sort: [ '{"lastUpdate":{"order":"desc"}}' ],
from: undefined,
size: undefined,
Expand All @@ -197,7 +196,6 @@ describe("Elasticsearch indexes tests", function () {
pageSize: 5,
}, {
index: 'offerings',
type: 'offerings',
sort: [ '{"lastUpdate":{"order":"desc"}}' ],
from: 10,
size: 5,
Expand All @@ -218,7 +216,6 @@ describe("Elasticsearch indexes tests", function () {
pageSize: 5,
}, {
index: 'offerings',
type: 'offerings',
sort: [ '{"lastUpdate":{"order":"desc"}}' ],
from: 10,
size: 5,
Expand All @@ -238,7 +235,6 @@ describe("Elasticsearch indexes tests", function () {
};
let expQuery = {
index: 'offerings',
type: 'offerings',
sort: [ '{"lastUpdate":{"order":"desc"}}' ],
from: undefined,
size: undefined,
Expand Down Expand Up @@ -285,7 +281,6 @@ describe("Elasticsearch indexes tests", function () {

let expQuery = {
index: 'products',
type: 'products',
sort: [ '{"lastUpdate":{"order":"desc"}}' ],
from: undefined,
size: undefined,
Expand All @@ -297,19 +292,18 @@ describe("Elasticsearch indexes tests", function () {
expect(clientSpy.search).toHaveBeenCalledWith(expQuery);
expect(clientSpy.exists).toHaveBeenCalledWith({
index: 'offerings',
type: 'offerings',
id: '3'
});
if (!exists) {
expect(clientSpy.create).toHaveBeenCalledWith({
index: 'offerings',
type: 'offerings',
id: '3',
body: {
id: 'offering:3',
originalId: '3',
sortedId: '000000000003',
catalog: '000000000002', body: [ 'offer', 'description' ],
catalog: '000000000002',
body: 'offer description',
userId: '1441a7909c087dbbe7ce59881b9df8b9',
lastUpdate: 1549015200000,
productSpecification: '000000000001',
Expand All @@ -321,14 +315,14 @@ describe("Elasticsearch indexes tests", function () {
} else {
expect(clientSpy.update).toHaveBeenCalledWith({
index: 'offerings',
type: 'offerings',
id: '3',
body: {
doc: {
id: 'offering:3',
originalId: '3',
sortedId: '000000000003',
catalog: '000000000002', body: [ 'offer', 'description' ],
catalog: '000000000002',
body: 'offer description',
userId: '1441a7909c087dbbe7ce59881b9df8b9',
lastUpdate: 1549015200000,
productSpecification: '000000000001',
Expand Down

0 comments on commit 7a6694e

Please sign in to comment.