mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Move crd into beforeEach
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
750cbfbff4
commit
7220edac41
@ -21,50 +21,54 @@ describe("<CustomResourceDetails />", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("with a CRD with a boolean field", () => {
|
describe("with a CRD with a boolean field", () => {
|
||||||
const crd = new CustomResourceDefinition({
|
let crd: CustomResourceDefinition;
|
||||||
apiVersion: "apiextensions.k8s.io/v1",
|
|
||||||
kind: "CustomResourceDefinition",
|
beforeEach(() => {
|
||||||
metadata: {
|
crd = new CustomResourceDefinition({
|
||||||
name: "my-crd",
|
apiVersion: "apiextensions.k8s.io/v1",
|
||||||
resourceVersion: "1",
|
kind: "CustomResourceDefinition",
|
||||||
selfLink: "/apis/apiextensions.k8s.io/v1/customresourcedefinitions/my-crd",
|
metadata: {
|
||||||
uid: "1",
|
name: "my-crd",
|
||||||
},
|
resourceVersion: "1",
|
||||||
spec: {
|
selfLink: "/apis/apiextensions.k8s.io/v1/customresourcedefinitions/my-crd",
|
||||||
versions: [{
|
uid: "1",
|
||||||
name: "v1",
|
},
|
||||||
served: true,
|
spec: {
|
||||||
storage: true,
|
versions: [{
|
||||||
schema: {
|
name: "v1",
|
||||||
openAPIV3Schema: {
|
served: true,
|
||||||
type: "object",
|
storage: true,
|
||||||
properties: {
|
schema: {
|
||||||
spec: {
|
openAPIV3Schema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
"my-field": {
|
spec: {
|
||||||
type: "boolean",
|
type: "object",
|
||||||
|
properties: {
|
||||||
|
"my-field": {
|
||||||
|
type: "boolean",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
additionalPrinterColumns: [
|
||||||
|
{
|
||||||
|
name: "MyField",
|
||||||
|
jsonPath: ".spec.my-field",
|
||||||
|
type: "boolean",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
group: "stable.lens.dev",
|
||||||
|
names: {
|
||||||
|
kind: "MyCrd",
|
||||||
|
plural: "my-crds",
|
||||||
},
|
},
|
||||||
additionalPrinterColumns: [
|
scope: "Cluster",
|
||||||
{
|
|
||||||
name: "MyField",
|
|
||||||
jsonPath: ".spec.my-field",
|
|
||||||
type: "boolean",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
group: "stable.lens.dev",
|
|
||||||
names: {
|
|
||||||
kind: "MyCrd",
|
|
||||||
plural: "my-crds",
|
|
||||||
},
|
},
|
||||||
scope: "Cluster",
|
});
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should display false in an additionalPrinterColumn as 'false'", () => {
|
it("should display false in an additionalPrinterColumn as 'false'", () => {
|
||||||
@ -109,50 +113,54 @@ describe("<CustomResourceDetails />", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("with a CRD with a number field", () => {
|
describe("with a CRD with a number field", () => {
|
||||||
const crd = new CustomResourceDefinition({
|
let crd: CustomResourceDefinition;
|
||||||
apiVersion: "apiextensions.k8s.io/v1",
|
|
||||||
kind: "CustomResourceDefinition",
|
beforeEach(() => {
|
||||||
metadata: {
|
crd = new CustomResourceDefinition({
|
||||||
name: "my-crd",
|
apiVersion: "apiextensions.k8s.io/v1",
|
||||||
resourceVersion: "1",
|
kind: "CustomResourceDefinition",
|
||||||
selfLink: "/apis/apiextensions.k8s.io/v1/customresourcedefinitions/my-crd",
|
metadata: {
|
||||||
uid: "1",
|
name: "my-crd",
|
||||||
},
|
resourceVersion: "1",
|
||||||
spec: {
|
selfLink: "/apis/apiextensions.k8s.io/v1/customresourcedefinitions/my-crd",
|
||||||
versions: [{
|
uid: "1",
|
||||||
name: "v1",
|
},
|
||||||
served: true,
|
spec: {
|
||||||
storage: true,
|
versions: [{
|
||||||
schema: {
|
name: "v1",
|
||||||
openAPIV3Schema: {
|
served: true,
|
||||||
type: "object",
|
storage: true,
|
||||||
properties: {
|
schema: {
|
||||||
spec: {
|
openAPIV3Schema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
"my-field": {
|
spec: {
|
||||||
type: "number",
|
type: "object",
|
||||||
|
properties: {
|
||||||
|
"my-field": {
|
||||||
|
type: "number",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
additionalPrinterColumns: [
|
||||||
|
{
|
||||||
|
name: "MyField",
|
||||||
|
jsonPath: ".spec.my-field",
|
||||||
|
type: "number",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
group: "stable.lens.dev",
|
||||||
|
names: {
|
||||||
|
kind: "MyCrd",
|
||||||
|
plural: "my-crds",
|
||||||
},
|
},
|
||||||
additionalPrinterColumns: [
|
scope: "Cluster",
|
||||||
{
|
|
||||||
name: "MyField",
|
|
||||||
jsonPath: ".spec.my-field",
|
|
||||||
type: "number",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
group: "stable.lens.dev",
|
|
||||||
names: {
|
|
||||||
kind: "MyCrd",
|
|
||||||
plural: "my-crds",
|
|
||||||
},
|
},
|
||||||
scope: "Cluster",
|
});
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should display 0 in an additionalPrinterColumn as '0'", () => {
|
it("should display 0 in an additionalPrinterColumn as '0'", () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user