Skip to content

Commit

Permalink
feat(goodstore): update tests and exports
Browse files Browse the repository at this point in the history
  • Loading branch information
tylermorrisford committed Oct 3, 2023
1 parent 8e7a9df commit 08640ad
Show file tree
Hide file tree
Showing 250 changed files with 4,734 additions and 1,760 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import empty from "./empty";
import empty from './empty';
import sampleDataGoodStore from './sample-data-goodstore';

const presets = {
empty,
sampleDataGoodStore,
};

export default presets;
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,124 @@ import skuADCT01 from './sku-ADCT01';
import skuADPC7 from './sku-ADPC7';
import skuADPC09 from './sku-ADPC09';
import skuALC01 from './sku-ALC01';

// TODO: complete preset exports
import skuAMR09 from './sku-AMR09';
import skuARG56 from './sku-ARG56';
import skuBA092 from './sku-BA092';
import skuBAMB084 from './sku-BAMB084';
import skuBARM03 from './sku-BARM03';
import skuBCOAS08 from './sku-BCOAS08';
import skuBLP01 from './sku-BLP01';
import skuBLPC09 from './sku-BLPC09';
import skuBR0983 from './sku-BR0983';
import skuBUCK023 from './sku-BUCK023';
import skuCARM023 from './sku-CARM023';
import skuCBM03 from './sku-CBM03';
import skuCCC09 from './sku-CCC09';
import skuCCG01 from './sku-CCG01';
import skuCCG02 from './sku-CCG02';
import skuCCH093 from './sku-CCH093';
import skuCCM089 from './sku-CCM089';
import skuCDG09 from './sku-CDG09';
import skuCJB01 from './sku-CJB01';
import skuCNS0434 from './sku-CNS0434';
import skuCOC0843 from './sku-COC0843';
import skuCQB09 from './sku-CQB09';
import skuCR098 from './sku-CR098';
import skuCST01 from './sku-CST01';
import skuCTSS098 from './sku-CTSS098';
import skuCTSS0983 from './sku-CTSS0983';
import skuCWG01 from './sku-CWG01';
import skuDWEG09 from './sku-DWEG09';
import skuEARM04 from './sku-EARM04';
import skuEC0993 from './sku-EC0993';
import skuEWC07 from './sku-EWC07';
import skuFARM05 from './sku-FARM05';
import skuFLAS094 from './sku-FLAS094';
import skuGARM093 from './sku-GARM093';
import skuGC01 from './sku-GC01';
import skuGMCT01 from './sku-GMCT01';
import skuGPC01 from './sku-GPC01';
import skuGPC02 from './sku-GPC02';
import skuGPC03 from './sku-GPC03';
import skuGRCG01 from './sku-GRCG01';
import skuHDG02 from './sku-HDG02';
import skuHP01 from './sku-HP01';
import skuILC01 from './sku-ILC01';
import skuIQB09 from './sku-IQB09';
import skuISP01 from './sku-ISP01';
import skuJAR08 from './sku-JAR08';
import skuLAMR03 from './sku-LAMR03';
import skuLBPC09 from './sku-LBPC09';
import skuLCO034 from './sku-LCO034';
import skuLCP01 from './sku-LCP01';
import skuLCP02 from './sku-LCP02';
import skuLPC09 from './sku-LPC09';
import skuLPC011 from './sku-LPC011';
import skuLPQB084 from './sku-LPQB084';
import skuMB0973 from './sku-MB0973';
import skuMCP01 from './sku-MCP01';
import skuMGD01 from './sku-MGD01';
import skuMLP01 from './sku-MLP01';
import skuMMST01 from './sku-MMST01';
import skuMMST02 from './sku-MMST02';
import skuMPC02 from './sku-MPC02';
import skuMPC07 from './sku-MPC07';
import skuMR05 from './sku-MR05';
import skuMR08 from './sku-MR08';
import skuMTB023 from './sku-MTB023';
import skuMTSS01 from './sku-MTSS01';
import skuMUQB01 from './sku-MUQB01';
import skuMWT01 from './sku-MWT01';
import skuNJOP09 from './sku-NJOP09';
import skuNR09 from './sku-NR09';
import skuNTSS01 from './sku-NTSS01';
import skuNTSS02 from './sku-NTSS02';
import skuNTSS03 from './sku-NTSS03';
import skuNTTS04 from './sku-NTTS04';
import skuNTSS05 from './sku-NTSS05';
import skuNTSS06 from './sku-NTSS06';
import skuNTSS07 from './sku-NTSS07';
import skuOTB07 from './sku-OTB07';
import skuPAP01 from './sku-PAP01';
import skuPMAP01 from './sku-PMAP01';
import skuRB01 from './sku-RB01';
import skuRB093 from './sku-RB093';
import skuRCC09 from './sku-RCC09';
import skuRCD01 from './sku-RCD01';
import skuRCQB01 from './sku-RCQB01';
import skuRLC08 from './sku-RLC08';
import skuRMP01 from './sku-RMP01';
import skuRST01 from './sku-RST01';
import skuRST02 from './sku-RST02';
import skuRWG09 from './sku-RWG09';
import skuSARM09 from './sku-SARM09';
import skuSARMO034 from './sku-SARMO034';
import skuSBG09 from './sku-SBG09';
import skuSCG09 from './sku-SCG09';
import skuSCM02 from './sku-SCM02';
import skuSGB01 from './sku-SGB01';
import skuSGB02 from './sku-SGB02';
import skuSHOT095 from './sku-SHOT095';
import skuSPC01 from './sku-SPC01';
import skuSPC06 from './sku-SPC06';
import skuSPOO094 from './sku-SPOO094';
import skuSQB034 from './sku-SQB034';
import skuSST02 from './sku-SST02';
import skuSTM09 from './sku-STM09';
import skuSTRA095 from './sku-STRA095';
import skuSWB01 from './sku-SWB01';
import skuTARM03 from './sku-TARM03';
import skuTARM034 from './sku-TARM034';
import skuTCM03 from './sku-TCM03';
import skuTLSS01 from './sku-TLSS01';
import skuTST02 from './sku-TST02';
import skuTTSS01 from './sku-TTSS01';
import skuVARM09 from './sku-VARM09';
import skuVC01 from './sku-VC01';
import skuWCS09 from './sku-WCS09';
import skuWCSI09 from './sku-WCSI09';
import skuWOP09 from './sku-WOP09';
import skuWTP09 from './sku-WTP09';

const presets = {
skuAAR34,
Expand All @@ -14,6 +130,124 @@ const presets = {
skuADPC7,
skuADPC09,
skuALC01,
skuAMR09,
skuARG56,
skuBA092,
skuBAMB084,
skuBARM03,
skuBCOAS08,
skuBLP01,
skuBLPC09,
skuBR0983,
skuBUCK023,
skuCARM023,
skuCBM03,
skuCCC09,
skuCCG01,
skuCCG02,
skuCCH093,
skuCCM089,
skuCDG09,
skuCJB01,
skuCNS0434,
skuCOC0843,
skuCQB09,
skuCR098,
skuCST01,
skuCTSS098,
skuCTSS0983,
skuCWG01,
skuDWEG09,
skuEARM04,
skuEC0993,
skuEWC07,
skuFARM05,
skuFLAS094,
skuGARM093,
skuGC01,
skuGMCT01,
skuGPC01,
skuGPC02,
skuGPC03,
skuGRCG01,
skuHDG02,
skuHP01,
skuILC01,
skuIQB09,
skuISP01,
skuJAR08,
skuLAMR03,
skuLBPC09,
skuLCO034,
skuLCP01,
skuLCP02,
skuLPC09,
skuLPC011,
skuLPQB084,
skuMB0973,
skuMCP01,
skuMGD01,
skuMLP01,
skuMMST01,
skuMMST02,
skuMPC02,
skuMPC07,
skuMR05,
skuMR08,
skuMTB023,
skuMTSS01,
skuMUQB01,
skuMWT01,
skuNJOP09,
skuNR09,
skuNTSS01,
skuNTSS02,
skuNTSS03,
skuNTTS04,
skuNTSS05,
skuNTSS06,
skuNTSS07,
skuOTB07,
skuPAP01,
skuPMAP01,
skuRB01,
skuRB093,
skuRCC09,
skuRCD01,
skuRCQB01,
skuRLC08,
skuRMP01,
skuRST01,
skuRST02,
skuRWG09,
skuSARM09,
skuSARMO034,
skuSBG09,
skuSCG09,
skuSCM02,
skuSGB01,
skuSGB02,
skuSHOT095,
skuSPC01,
skuSPC06,
skuSPOO094,
skuSQB034,
skuSST02,
skuSTM09,
skuSTRA095,
skuSWB01,
skuTARM03,
skuTARM034,
skuTCM03,
skuTLSS01,
skuTST02,
skuTTSS01,
skuVARM09,
skuVC01,
skuWCS09,
skuWCSI09,
skuWOP09,
skuWTP09,
};

export default presets;
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@

import { TInventoryEntryDraft, TInventoryEntryDraftGraphql } from '../../../types';
import {
TInventoryEntryDraft,
TInventoryEntryDraftGraphql,
} from '../../../types';
import skuAAR34 from './sku-AAR34';

describe('With skuAAR34 preset', () => {
it('should return skuAAR34 preset', () => {
const skuAAR34Preset = skuAAR34().build<TInventoryEntryDraft>();
expect(skuAAR34Preset).toMatchInlineSnapshot(``);
});
it('should return skuAAR34 preset', () => {
const skuAAR34Preset = skuAAR34().build<TInventoryEntryDraft>();
expect(skuAAR34Preset).toMatchInlineSnapshot(`
{
"custom": null,
"expectedDelivery": undefined,
"key": undefined,
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "AAR-34",
"supplyChannel": undefined,
}
`);
});

it('should return skuAAR34 preset when built for GraphQL', () => {
const skuAAR34PresetGraphql = skuAAR34().buildGraphql<TInventoryEntryDraftGraphql>();
expect(skuAAR34PresetGraphql).toMatchInlineSnapshot(``);
});
it('should return skuAAR34 preset when built for GraphQL', () => {
const skuAAR34PresetGraphql =
skuAAR34().buildGraphql<TInventoryEntryDraftGraphql>();
expect(skuAAR34PresetGraphql).toMatchInlineSnapshot(`
{
"__typename": "InventoryEntryDraft",
"custom": null,
"expectedDelivery": undefined,
"key": undefined,
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "AAR-34",
"supplyChannel": undefined,
}
`);
});
});


Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import type { TInventoryEntryDraftBuilder } from '../../../types';
import { ProductVariantDraft, type TProductVariantDraft } from '@commercetools-test-data/product';
import * as InventoryEntryDraft from '../../index';

const productPreset = ProductVariantDraft.presets.sampleDataGoodStore.ariaRug01().build<TProductVariantDraft>();
const ariaRug01Preset = ProductVariantDraft.presets.sampleDataGoodStore.ariaRug01().build<TProductVariantDraft>();

const skuAAR34 = (): TInventoryEntryDraftBuilder =>
InventoryEntryDraft.presets
.empty()
.sku(productPreset.sku!)
.sku(ariaRug01Preset.sku!)
.quantityOnStock(100);

export default skuAAR34;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@

import { TInventoryEntryDraft, TInventoryEntryDraftGraphql } from '../../../types';
import {
TInventoryEntryDraft,
TInventoryEntryDraftGraphql,
} from '../../../types';
import skuADARM04 from './sku-ADARM04';

describe('With skuADARM04 preset', () => {
it('should return skuADARM04 preset', () => {
const skuADARM04Preset = skuADARM04().build<TInventoryEntryDraft>();
expect(skuADARM04Preset).toMatchInlineSnapshot(``);
});
it('should return skuADARM04 preset', () => {
const skuADARM04Preset = skuADARM04().build<TInventoryEntryDraft>();
expect(skuADARM04Preset).toMatchInlineSnapshot(`
{
"custom": null,
"expectedDelivery": undefined,
"key": undefined,
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "ADARM-04",
"supplyChannel": undefined,
}
`);
});

it('should return skuADARM04 preset when built for GraphQL', () => {
const skuADARM04PresetGraphql = skuADARM04().buildGraphql<TInventoryEntryDraftGraphql>();
expect(skuADARM04PresetGraphql).toMatchInlineSnapshot(``);
});
it('should return skuADARM04 preset when built for GraphQL', () => {
const skuADARM04PresetGraphql =
skuADARM04().buildGraphql<TInventoryEntryDraftGraphql>();
expect(skuADARM04PresetGraphql).toMatchInlineSnapshot(`
{
"__typename": "InventoryEntryDraft",
"custom": null,
"expectedDelivery": undefined,
"key": undefined,
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "ADARM-04",
"supplyChannel": undefined,
}
`);
});
});


Loading

0 comments on commit 08640ad

Please sign in to comment.