Skip to content

Commit

Permalink
test: đź’Ť fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaskaransarkaria committed Nov 24, 2021
1 parent b6a130e commit 3452f94
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 185 deletions.
2 changes: 1 addition & 1 deletion .routify/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ module.exports = {
noHashScroll: false,
distDir: 'dist',
extensions: ['svelte', 'html', 'svx', 'md'],
started: '2021-11-23T18:50:22.587Z',
started: '2021-11-24T19:14:39.743Z',
};
4 changes: 2 additions & 2 deletions .routify/routes.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* @roxi/routify 2.7.3
* File generated Tue Nov 23 2021 18:50:25 GMT+0000 (Greenwich Mean Time)
* File generated Wed Nov 24 2021 19:14:42 GMT+0000 (Greenwich Mean Time)
*/

export const __version = '2.7.3';
export const __timestamp = '2021-11-23T18:50:25.549Z';
export const __timestamp = '2021-11-24T19:14:42.752Z';

//buildRoutes
import { buildClientTree } from '@roxi/routify/runtime/buildRoutes';
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

<link rel='icon' type='image/png' href='/favicon.png'>
<link rel='stylesheet' href='/global.css'>
<link rel='stylesheet' href='/build/bundle-1637693422585.css'>
<link rel='stylesheet' href='/build/bundle-1637781279741.css'>

<script defer src='/build/bundle-1637693422585.js'></script>
<script defer src='/build/bundle-1637781279741.js'></script>
</head>
<body>
</body>
Expand Down
50 changes: 33 additions & 17 deletions src/components/ProductView/ProductView.svelte
Original file line number Diff line number Diff line change
@@ -1,37 +1,53 @@
<script lang="typescript">
import { groupBy } from 'lodash-es';
import { fade } from 'svelte/transition';
import SingleProduct from '@/components/SingleProduct/SingleProduct.svelte';
import VariantProducts from '@/components/VariantProducts/VariantProducts.svelte';
import type { Product } from '@/types/product';
export let productArr: readonly Product[] = [];
export let showDetailedView = false;
let variantArr: readonly Product[] = [];
let nonVariantArr: readonly Product[] = [];
let groupedVariantProducts: Array<readonly Product[]>;
$: groupedVariantProducts = Object.values(
groupBy(variantArr, 'VariantGroupId')
);
$: if (productArr.length) {
variantArr = productArr.filter(({ VariantGroupId }) => !!VariantGroupId);
nonVariantArr = productArr.filter(({ VariantGroupId }) => !VariantGroupId);
}
</script>

<div
in:fade={{ delay: 500 }}
class={showDetailedView || productArr.length - variantArr.length <= 2
? 'detailed-products-container'
: 'products-container'}
>
{#if nonVariantArr.length}
{#each nonVariantArr as product}
<SingleProduct {product} {showDetailedView} />
{/each}
{/if}
{#if variantArr.length}
<VariantProducts variantProducts={variantArr} {showDetailedView} />
{/if}
</div>
{#if variantArr.length}
{#each groupedVariantProducts as variants (variants)}
<div
in:fade={{ delay: 500 }}
class={showDetailedView
? 'detailed-products-container'
: 'products-container'}
>
{#each variants as variant (variant)}
<SingleProduct product={variant} />
{/each}
</div>
{/each}
{:else}
<div
in:fade={{ delay: 500 }}
class={showDetailedView
? 'detailed-products-container'
: 'products-container'}
>
{#if nonVariantArr.length}
{#each nonVariantArr as product}
<SingleProduct {product} {showDetailedView} />
{/each}
{/if}
</div>
{/if}

<style>
.products-container {
Expand Down
79 changes: 0 additions & 79 deletions src/components/VariantProducts/VariantProducts.svelte

This file was deleted.

84 changes: 0 additions & 84 deletions src/components/VariantProducts/VariantProducts.test.ts

This file was deleted.

0 comments on commit 3452f94

Please sign in to comment.