-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Hi.
In the code below, I am trying to remove an option from an option set field but when I call getOptions() the option still there.
Code
import { } from "mocha";
import { expect } from "chai";
import { XrmMockGenerator } from "xrm-mock";
describe("On Load Form", () => {
beforeEach(() => {
XrmMockGenerator.initialise();
XrmMockGenerator.Attribute.createOptionSet("countries", 0, [
{ text: "Austria", value: 0 },
{ text: "France", value: 1 },
{ text: "Spain", value: 2 }
]);
});
it("Filter optionset", () => {
let formContext = XrmMockGenerator.eventContext.getFormContext();
let control = formContext.getControl<Xrm.Controls.OptionSetControl>("countries");
control.removeOption(2);
let length = formContext.getAttribute<Xrm.Attributes.OptionSetAttribute>("countries").getOptions().length;
expect(length).to.equal(2);
});
});
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
