Skip to content

Commit

Permalink
Merge pull request #51 from shopware/fix-type-error
Browse files Browse the repository at this point in the history
chore(ci): run build in ci
  • Loading branch information
pweyck authored Jul 4, 2024
2 parents a909f94 + beca984 commit 940b07e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ jobs:
target-branch: ${{ github.event.pull_request.base.ref }}
current-branch: ${{ github.event.pull_request.head.ref }}
pattern: '^\s*(feat|fix|ci|chore|docs|test|style|refactor)(\(.{1,}\))?!?: .{1,}$'
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
test:
timeout-minutes: 15
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/DefaultSalesChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const test = base.extend<NonNullable<unknown>, FixtureTypes>({
const currency = await requests.currencyEUR;

await use({
enGBLocaleId: lang.localeId,
enGBLocaleId: lang.translationCode.id,
enGBLanguageId: lang.id,
storefrontTypeId: '8a243080f92e4c719546314b577cf82b',
eurCurrencyId: currency.id,
Expand Down
8 changes: 3 additions & 5 deletions src/services/ShopwareDataHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { components } from '@shopware/api-client/admin-api-types';

type Language = components['schemas']['Currency'] & {
id: string,
translationCode: components['schemas']['Locale'] & { id: string },
}

export const getLanguageData = async (
Expand All @@ -23,16 +24,13 @@ export const getLanguageData = async (
},
});

const result = (await resp.json()) as { data: { id: string; translationCode: { id: string } }[]; total: number };
const result = await resp.json();

if (result.data.length === 0) {
throw new Error(`Language ${languageCode} not found`);
}

return {
id: result.data[0].id,
localeId: result.data[0].translationCode.id,
};
return result.data[0];
};

export const getSnippetSetId = async (languageCode: string, adminApiContext: AdminApiContext): Promise<string> => {
Expand Down
8 changes: 4 additions & 4 deletions src/tasks/shop-customer/Product/AddProductToCart.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { test as base } from '@playwright/test';
import type { Task } from '../../../types/Task';
import type { FixtureTypes} from '../../../types/FixtureTypes';
import type { ProductType } from '../../../data-fixtures/DataFixtures';
import type { FixtureTypes } from '../../../types/FixtureTypes';
import { Product } from '../../../types/ShopwareTypes';

export const AddProductToCart = base.extend<{ AddProductToCart: Task }, FixtureTypes>({
AddProductToCart: async ({ ShopCustomer, StorefrontProductDetail }, use)=> {
const task = (ProductData: ProductType, quantity = '1') => {
AddProductToCart: async ({ ShopCustomer, StorefrontProductDetail }, use) => {
const task = (ProductData: Product, quantity = '1') => {
return async function AddProductToCart() {
await StorefrontProductDetail.quantitySelect.fill(quantity);

Expand Down

0 comments on commit 940b07e

Please sign in to comment.