Skip to content

Commit

Permalink
Merge pull request metabase#7376 from metabase/use-real-fake-addresse…
Browse files Browse the repository at this point in the history
…s-in-sample-dataset

Don't put sample dataset people in the ocean any more
  • Loading branch information
camsaul authored Apr 20, 2018
2 parents 6ec2353 + d7b2688 commit e8d6511
Show file tree
Hide file tree
Showing 12 changed files with 17,703 additions and 177 deletions.
Binary file modified frontend/test/__runner__/test_db_fixture.db.h2.db
Binary file not shown.
4 changes: 2 additions & 2 deletions frontend/test/metabase-lib/Question.integ.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe("Question", () => {
question._parameterValues = { [templateTagId]: "5" };
const results2 = await question.apiGetResults({ ignoreCache: true });
expect(results2[0]).toBeDefined();
expect(results2[0].data.rows[0][0]).toEqual(116.35497575401975);
expect(results2[0].data.rows[0][0]).toEqual(127.88197029833711);
});

it("should return correct result with an optional template tag clause", async () => {
Expand Down Expand Up @@ -79,7 +79,7 @@ describe("Question", () => {
question._parameterValues = { [templateTagId]: "5" };
const results2 = await question.apiGetResults({ ignoreCache: true });
expect(results2[0]).toBeDefined();
expect(results2[0].data.rows[0][0]).toEqual(116.35497575401975);
expect(results2[0].data.rows[0][0]).toEqual(127.88197029833711);
});
});
});
8 changes: 4 additions & 4 deletions frontend/test/parameters/parameters.integ.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ async function sharedParametersTests(getAppAndStore) {
.slice(0, -1), // the last item is the input, remove it
);
expect(values).toEqual([
["Adelia Eichmann - 1"], // remapped value
["Hudson Borer - 1"], // remapped value
[],
[],
[],
Expand All @@ -477,15 +477,15 @@ async function sharedParametersTests(getAppAndStore) {
expect(widget.find("li").length).toEqual(1 + 1);
widget.find("input").simulate("change", { target: { value: "Aly" } });
await waitForRequestToComplete("GET", /\/field\/.*\/search/);
expect(widget.find("li").length).toEqual(1 + 1 + 6);
expect(widget.find("li").length).toEqual(1 + 1 + 4);
});
it("should allow searching PEOPLE.NAME by PEOPLE.NAME", async () => {
const widget = app.find(FieldValuesWidget).at(1);
// tests `search` endpoint
expect(widget.find("li").length).toEqual(1);
widget.find("input").simulate("change", { target: { value: "Aly" } });
await waitForRequestToComplete("GET", /\/field\/.*\/search/);
expect(widget.find("li").length).toEqual(1 + 6);
expect(widget.find("li").length).toEqual(1 + 4);
});
it("should show values for PEOPLE.SOURCE", async () => {
const widget = app.find(FieldValuesWidget).at(2);
Expand All @@ -500,6 +500,6 @@ async function sharedParametersTests(getAppAndStore) {
expect(widget.find("li").length).toEqual(1);
widget.find("input").simulate("change", { target: { value: "Aly" } });
await waitForRequestToComplete("GET", /\/field\/.*\/search/);
expect(widget.find("li").length).toEqual(1 + 6);
expect(widget.find("li").length).toEqual(1 + 4);
});
}
4 changes: 2 additions & 2 deletions frontend/test/public/public.integ.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ const getRelativeUrlWithoutHash = url =>
url.replace(/#.*$/, "").replace(/http:\/\/.*?\//, "/");

const COUNT_ALL = "200";
const COUNT_DOOHICKEY = "51";
const COUNT_GADGET = "47";
const COUNT_DOOHICKEY = "42";
const COUNT_GADGET = "53";

describe("public/embedded", () => {
beforeAll(async () => useSharedAdminLogin());
Expand Down
8 changes: 4 additions & 4 deletions frontend/test/pulse/pulse.integ.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,21 @@ describe("Pulse", () => {
expect(previews.length).toBe(2);

// NOTE: check text content since enzyme doesn't doesn't seem to work well with dangerouslySetInnerHTML
expect(previews.at(0).text()).toBe("count12,805");
expect(previews.at(0).text()).toBe("count18,760");
expect(previews.at(0).find(".Icon-attachment").length).toBe(1);
expect(previews.at(1).text()).toEqual(
expect.stringContaining("Showing 20 of 12,805 rows"),
expect.stringContaining("Showing 20 of 18,760 rows"),
);
expect(previews.at(1).find(".Icon-attachment").length).toBe(0);

// toggle email channel off
click(app.find(Toggle).first());

previews = app.find(PulseCardPreview);
expect(previews.at(0).text()).toBe("count12,805");
expect(previews.at(0).text()).toBe("count18,760");
expect(previews.at(0).find(".Icon-attachment").length).toBe(0);
expect(previews.at(1).text()).toEqual(
expect.stringContaining("Showing 20 of 12,805 rows"),
expect.stringContaining("Showing 20 of 18,760 rows"),
);
expect(previews.at(1).find(".Icon-attachment").length).toBe(0);

Expand Down
8 changes: 4 additions & 4 deletions frontend/test/query_builder/qb_drillthrough.integ.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ describe("QueryBuilder", () => {
.find("td");
expect(firstRowCells.length).toBe(2);

expect(firstRowCells.first().text()).toBe("AA");
expect(firstRowCells.first().text()).toBe("AK");

const countCell = firstRowCells.last();
expect(countCell.text()).toBe("233");
expect(countCell.text()).toBe("474");
click(countCell.children().first());

// Drill-through is delayed in handleVisualizationClick of Visualization.jsx by 100ms
Expand Down Expand Up @@ -239,10 +239,10 @@ describe("QueryBuilder", () => {
.find("td");
expect(firstRowCells.length).toBe(2);

expect(firstRowCells.first().text()).toBe("90° S80° S");
expect(firstRowCells.first().text()).toBe("20° N30° N");

const countCell = firstRowCells.last();
expect(countCell.text()).toBe("701");
expect(countCell.text()).toBe("579");
click(countCell.children().first());

// Drill-through is delayed in handleVisualizationClick of Visualization.jsx by 100ms
Expand Down
14 changes: 7 additions & 7 deletions frontend/test/query_builder/qb_editor_bar.integ.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,13 @@ describe("QueryBuilder editor bar", () => {
await store.waitForActions([QUERY_COMPLETED]);

// We can use the visible row count as we have a low number of result rows
expect(qb.find(".ShownRowCount").text()).toBe("Showing 6 rows");
expect(qb.find(".ShownRowCount").text()).toBe("Showing 11 rows");

// Get the binning
const results = getQueryResults(store.getState())[0];
const breakoutBinningInfo = results.data.cols[0].binning_info;
expect(breakoutBinningInfo.binning_strategy).toBe("num-bins");
expect(breakoutBinningInfo.bin_width).toBe(50);
expect(breakoutBinningInfo.bin_width).toBe(30);
expect(breakoutBinningInfo.num_bins).toBe(8);
});
it("lets you change the binning strategy to 100 bins", async () => {
Expand Down Expand Up @@ -272,7 +272,7 @@ describe("QueryBuilder editor bar", () => {
click(qb.find(RunButton));
await store.waitForActions([QUERY_COMPLETED]);

expect(qb.find(".ShownRowCount").text()).toBe("Showing 105 rows");
expect(qb.find(".ShownRowCount").text()).toBe("Showing 116 rows");
const results = getQueryResults(store.getState())[0];
const breakoutBinningInfo = results.data.cols[0].binning_info;
expect(breakoutBinningInfo.binning_strategy).toBe("num-bins");
Expand Down Expand Up @@ -346,13 +346,13 @@ describe("QueryBuilder editor bar", () => {
click(qb.find(RunButton));
await store.waitForActions([QUERY_COMPLETED]);

expect(qb.find(".ShownRowCount").text()).toBe("Showing 18 rows");
expect(qb.find(".ShownRowCount").text()).toBe("Showing 6 rows");

const results = getQueryResults(store.getState())[0];
const breakoutBinningInfo = results.data.cols[0].binning_info;
expect(breakoutBinningInfo.binning_strategy).toBe("bin-width");
expect(breakoutBinningInfo.bin_width).toBe(10);
expect(breakoutBinningInfo.num_bins).toBe(18);
expect(breakoutBinningInfo.num_bins).toBe(6);
});

it("lets you group by Latitude with the 'Bin every 1 degree'", async () => {
Expand Down Expand Up @@ -381,13 +381,13 @@ describe("QueryBuilder editor bar", () => {
click(qb.find(RunButton));
await store.waitForActions([QUERY_COMPLETED]);

expect(qb.find(".ShownRowCount").text()).toBe("Showing 180 rows");
expect(qb.find(".ShownRowCount").text()).toBe("Showing 40 rows");

const results = getQueryResults(store.getState())[0];
const breakoutBinningInfo = results.data.cols[0].binning_info;
expect(breakoutBinningInfo.binning_strategy).toBe("bin-width");
expect(breakoutBinningInfo.bin_width).toBe(1);
expect(breakoutBinningInfo.num_bins).toBe(180);
expect(breakoutBinningInfo.num_bins).toBe(46);
});
});
});
Loading

0 comments on commit e8d6511

Please sign in to comment.