Browse Source

test: erd changes for mm bridge table fix

Signed-off-by: mertmit <mertmit99@gmail.com>
feat/export-nest
mertmit 2 years ago
parent
commit
dc3cfab795
  1. 32
      tests/playwright/tests/db/erd.spec.ts
  2. 4
      tests/playwright/tests/utils/sakila.ts

32
tests/playwright/tests/db/erd.spec.ts

@ -70,16 +70,16 @@ test.describe('Erd', () => {
if (isPg(context)) { if (isPg(context)) {
await erd.verifyNodesCount(sakilaTables.length); await erd.verifyNodesCount(sakilaTables.length);
await erd.verifyEdgesCount({ await erd.verifyEdgesCount({
count: 32, count: 38,
circleCount: 29, circleCount: 36,
rectangleCount: 35, rectangleCount: 40,
}); });
} else { } else {
await erd.verifyNodesCount(mysqlSakilaTables.length); await erd.verifyNodesCount(mysqlSakilaTables.length);
await erd.verifyEdgesCount({ await erd.verifyEdgesCount({
count: 14, count: 20,
circleCount: 11, circleCount: 18,
rectangleCount: 17, rectangleCount: 22,
}); });
} }
for (const tableName of sakilaTables) { for (const tableName of sakilaTables) {
@ -132,16 +132,16 @@ test.describe('Erd', () => {
if (isPg(context)) { if (isPg(context)) {
await erd.verifyNodesCount(sakilaTables.length + sakilaSqlViews.length); await erd.verifyNodesCount(sakilaTables.length + sakilaSqlViews.length);
await erd.verifyEdgesCount({ await erd.verifyEdgesCount({
count: 32, count: 38,
circleCount: 29, circleCount: 36,
rectangleCount: 35, rectangleCount: 40,
}); });
} else { } else {
await erd.verifyNodesCount(sakilaTables.length + sakilaSqlViews.length); await erd.verifyNodesCount(sakilaTables.length + sakilaSqlViews.length);
await erd.verifyEdgesCount({ await erd.verifyEdgesCount({
count: 14, count: 20,
circleCount: 11, circleCount: 18,
rectangleCount: 17, rectangleCount: 22,
}); });
} }
@ -157,7 +157,7 @@ test.describe('Erd', () => {
await erd.clickShowSqlViews(); // disable sql views await erd.clickShowSqlViews(); // disable sql views
await erd.verifyNodeDoesNotExist({ tableName: `store` }); await erd.verifyNodeDoesNotExist({ tableName: `film_actor` });
// // Verify MM tables // // Verify MM tables
await erd.clickShowMMTables(); await erd.clickShowMMTables();
@ -166,12 +166,12 @@ test.describe('Erd', () => {
await erd.verifyNodesCount(isPg(context) ? 21 : 16); await erd.verifyNodesCount(isPg(context) ? 21 : 16);
await erd.verifyEdgesCount({ await erd.verifyEdgesCount({
count: isPg(context) ? 44 : 26, count: isPg(context) ? 42 : 24,
circleCount: isPg(context) ? 40 : 22, circleCount: isPg(context) ? 40 : 22,
rectangleCount: isPg(context) ? 48 : 30, rectangleCount: isPg(context) ? 44 : 26,
}); });
await erd.verifyNode({ tableName: `store` }); await erd.verifyNode({ tableName: `film_actor` });
// Verify show junction table names // Verify show junction table names
await erd.clickShowJunctionTableNames(); await erd.clickShowJunctionTableNames();

4
tests/playwright/tests/utils/sakila.ts

@ -11,6 +11,8 @@ const mysqlSakilaTables = [
'payment', 'payment',
'rental', 'rental',
'staff', 'staff',
'inventory',
'store',
]; ];
const mysqlSakilaSqlViews = [ const mysqlSakilaSqlViews = [
@ -41,6 +43,8 @@ const pgSakilaTables = [
'payment_p2007_06', 'payment_p2007_06',
'rental', 'rental',
'staff', 'staff',
'inventory',
'store',
]; ];
const pgSakilaSqlViews = [ const pgSakilaSqlViews = [

Loading…
Cancel
Save