This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _ from "lodash"; | |
function deCapitalizeFirstLetter(string: string) { | |
return string.charAt(0).toLowerCase() + string.slice(1); | |
} | |
function replaceKeysDeep(obj: object | unknown[]) { | |
// @ts-ignore | |
return _.transform(obj, function ( | |
result: { [key: string]: unknown }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Background } from "xolvio-ui/elements/Background"; | |
import { Title } from "xolvio-ui/components/Title"; | |
import { CenteredContentWrapper } from "xolvio-ui/helpers/CenteredContentWrapper"; | |
export const Services = () => ( | |
<CenteredContentWrapper> | |
<Background/> | |
<Title title="hello" subheading="world" /> | |
</CenteredContentWrapper> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Configure our plugin in your app's webpack.config.js like this: | |
plugins: [ | |
new StorybookWebpackFederationPlugin({ | |
remotes: ["xolvio-ui"], | |
}) | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Configure our plugin in your Storybook webpack.config.js like this: | |
plugins: [ | |
new StorybookWebpackFederationPlugin({ | |
name: "xolvio-ui", | |
files: { | |
paths: ["./src/**/*.ts{,x}"] | |
} | |
}) | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.estimateShipping = ({price, weight}) => { | |
if (price > 1000) { | |
return 0 | |
} | |
return weight / 2; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test("estimateShipping should be calculated as 1 dollar per 2 pounds for an item with a price of 1000 or below", () => { | |
expect(estimateShipping({price: 1000, weight: 500})).toEqual(250) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.estimateShipping = ({price, weight}) => { | |
if (price > 1000) { | |
return 0 | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test("estimateShipping should be 0 for an item with a price over 1000", () => { | |
expect(estimateShipping({price: 1001})).toStrictEqual(0) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { estimateShipping } = require("./estimateShipping"); | |
test("estimateShipping should be 0 for an item with a price over 1000", () => { | |
expect(estimateShipping({price: 1001})).toEqual(0) | |
}); | |
test("estimateShipping should be calculated as 1 dollar per 2 pounds for an item with a price of 1000 or below", () => { | |
expect(estimateShipping({price: 1000, weight: 500})).toEqual(250) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { estimateShipping } = require("./estimateShipping"); | |
test.todo("estimateShipping should be 0 for an item with a price over 1000"); | |
test.todo("estimateShipping should be calculated as 1 dollar per 2 pounds for an item with a price of 1000 or below"); |
NewerOlder