Skip to content
Snippets Groups Projects
Unverified Commit 3927d0c7 authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Remove Number from semantic types (#17109)

parent 02d0adcb
No related branches found
No related tags found
No related merge requests found
......@@ -38,11 +38,6 @@ export const field_semantic_types = [
name: t`Description`,
section: t`Common`,
},
{
id: TYPE.Number,
name: t`Number`,
section: t`Common`,
},
{
id: TYPE.Title,
name: t`Title`,
......
......@@ -48,16 +48,10 @@ describe("scenarios > admin > datamodel > field > field type", () => {
getFKTargetField("Products → ID");
});
it.skip("should let you change the type to 'Number' (metabase#16781)", () => {
it("should not let you change the type to 'Number' (metabase#16781)", () => {
visitAlias("@ORDERS_PRODUCT_ID_URL");
setFieldType({ oldValue: "Foreign Key", newValue: "Number" });
waitAndAssertOnResponse("fieldUpdate");
cy.reload();
getFieldType("Number");
checkNoFieldType({ oldValue: "Foreign Key", newValue: "Number" });
});
});
......@@ -77,15 +71,27 @@ function getFieldType(type) {
function setFieldType({ oldValue, newValue } = {}) {
getFieldType(oldValue).click();
popover().within(() => {
searchFieldType(newValue);
cy.findByText(newValue).click();
});
}
function checkNoFieldType({ oldValue, newValue } = {}) {
getFieldType(oldValue).click();
popover().within(() => {
cy.get(".ReactVirtualized__Grid").scrollTo(0, 0); // HACK: scroll to the top of the list. Ideally we should probably disable AccordionList virtualization
cy.findByPlaceholderText("Find...").type(newValue);
cy.get(".List-item")
.contains(newValue)
.click();
searchFieldType(newValue);
cy.queryByText(newValue).should("not.exist");
});
}
function searchFieldType(type) {
cy.get(".ReactVirtualized__Grid").scrollTo(0, 0); // HACK: scroll to the top of the list. Ideally we should probably disable AccordionList virtualization
cy.findByPlaceholderText("Find...").type(type);
}
function getFKTargetField(targetField) {
return cy
.get(".TableEditor-field-target")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment