Skip to content

Commit 849a497

Browse files
committed
fix: reemplazar faker.string.* por API compatible con faker v7 en todos los tests
Made-with: Cursor
1 parent 43da094 commit 849a497

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

fixtures/show.fixture.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { faker } = require("@faker-js/faker");
99

1010
const createShow = async (authRequest, attrs = {}) => {
1111
const payload = {
12-
title: `[QA-AUTO] Show ${faker.string.alphanumeric(6)} ${Date.now()}`,
12+
title: `[QA-AUTO] Show ${faker.random.alphaNumeric(6)} ${Date.now()}`,
1313
type: "tvshow",
1414
account: process.env.ACCOUNT_ID || "test-account",
1515
...attrs,

tests/live/live.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ test.describe("Live Stream API", () => {
155155
test("TC_LIV_004_POST_UpdateNameOnly", async ({ authRequest }) => {
156156
if (!(await ensureLiveApiAvailable(authRequest))) return;
157157
const stream = await createLiveStream(authRequest);
158-
const newName = `updated_${faker.string.alphanumeric(6)}`;
158+
const newName = `updated_${faker.random.alphaNumeric(6)}`;
159159
try {
160160
const updRes = await authRequest.post(`${API_BASE}/${stream._id}`, {
161161
form: { name: newName },
@@ -207,7 +207,7 @@ test.describe("Live Stream API", () => {
207207
test.describe("2. Búsqueda y Filtros", () => {
208208
test("TC_LIV_006_GET_SearchByName", async ({ authRequest }) => {
209209
if (!(await ensureLiveApiAvailable(authRequest))) return;
210-
const unique = `qa_search_${Date.now()}_${faker.string.alphanumeric(4)}`;
210+
const unique = `qa_search_${Date.now()}_${faker.random.alphaNumeric(4)}`;
211211
const stream = await createLiveStream(authRequest, { name: unique });
212212
try {
213213
const searchRes = await authRequest.get(

tests/media/media.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function buildFilterQuery(filters) {
2828

2929
async function createMedia(authRequest, attrs = {}) {
3030
const payload = {
31-
title: `qa_${faker.string.alphanumeric(8)}_${Date.now()}`,
31+
title: `qa_${faker.random.alphaNumeric(8)}_${Date.now()}`,
3232
type: "video",
3333
visible: "true",
3434
is_published: "false",
@@ -279,7 +279,7 @@ test.describe("3. Read Media (GET /api/media & /api/media/:id)", () => {
279279
test.describe("4. Partial Update (POST /api/media/:id)", () => {
280280
test("TC_MED_010_UPDATE_ChangeTitleOnly", async ({ authRequest }) => {
281281
const media = await createMedia(authRequest, { description: "original_desc" });
282-
const newTitle = `updated_${faker.string.alphanumeric(6)}`;
282+
const newTitle = `updated_${faker.random.alphaNumeric(6)}`;
283283

284284
try {
285285
const updRes = await authRequest.post(`/api/media/${media._id}`, {
@@ -533,8 +533,8 @@ test.describe("10. Subrecursos (Metas)", () => {
533533
// --- 7. Suite: Search (GET /api/media/search) - con seed ---
534534

535535
test.describe("7. Search (GET /api/media/search)", () => {
536-
const uniqueTag = `search_${faker.string.uuid()}`;
537-
const titlePrefix = `SearchTC_${faker.string.alphanumeric(6)}`;
536+
const uniqueTag = `search_${faker.datatype.uuid()}`;
537+
const titlePrefix = `SearchTC_${faker.random.alphaNumeric(6)}`;
538538
let createdIds = [];
539539

540540
test.beforeAll(async ({ authRequest }) => {

0 commit comments

Comments
 (0)