# Instructions

- Following Playwright test failed.
- Explain why, be concise, respect Playwright best practices.
- Provide a snippet of code with the fix, if possible.

# Test info

- Name: transaction-full.spec.ts >> 散客做单 >> 金额为0应报错
- Location: tests/transaction-full.spec.ts:215:7

# Error details

```
Error: expect(received).not.toBe(expected) // Object.is equality

Expected: not 201
```

# Test source

```ts
  124 |       headers: headers(),
  125 |       data: makeTransaction({
  126 |         items: [serviceItem(SVC_PURE, '纯色美甲', 8800)],
  127 |         tip_cents: 880,
  128 |         split_payments: [{ method: 'cash', amount_cents: 9680 }],
  129 |       }),
  130 |     });
  131 |     expect(res.status()).toBe(201);
  132 |     const data = await res.json();
  133 |     expect(data.total_cents).toBe(9680);
  134 |   });
  135 | 
  136 |   test('带小费 - 现金结账（自定义金额）', async ({ request }) => {
  137 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  138 |       headers: headers(),
  139 |       data: makeTransaction({
  140 |         items: [serviceItem(SVC_PURE, '纯色美甲', 8800)],
  141 |         tip_cents: 2000,
  142 |         split_payments: [{ method: 'cash', amount_cents: 10800 }],
  143 |       }),
  144 |     });
  145 |     expect(res.status()).toBe(201);
  146 |     const data = await res.json();
  147 |     expect(data.total_cents).toBe(10800);
  148 |   });
  149 | 
  150 |   test('微信支付', async ({ request }) => {
  151 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  152 |       headers: headers(),
  153 |       data: makeTransaction({
  154 |         items: [serviceItem(SVC_PURE, '纯色美甲', 8800)],
  155 |         method: 'wechat_pay',
  156 |         split_payments: [{ method: 'wechat_pay', amount_cents: 8800 }],
  157 |       }),
  158 |     });
  159 |     expect(res.status()).toBe(201);
  160 |   });
  161 | 
  162 |   test('支付宝支付', async ({ request }) => {
  163 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  164 |       headers: headers(),
  165 |       data: makeTransaction({
  166 |         items: [serviceItem(SVC_PURE, '纯色美甲', 8800)],
  167 |         method: 'alipay',
  168 |         split_payments: [{ method: 'alipay', amount_cents: 8800 }],
  169 |       }),
  170 |     });
  171 |     expect(res.status()).toBe(201);
  172 |   });
  173 | 
  174 |   test('银行卡支付', async ({ request }) => {
  175 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  176 |       headers: headers(),
  177 |       data: makeTransaction({
  178 |         items: [serviceItem(SVC_PURE, '纯色美甲', 8800)],
  179 |         method: 'bank_card',
  180 |         split_payments: [{ method: 'bank_card', amount_cents: 8800 }],
  181 |       }),
  182 |     });
  183 |     expect(res.status()).toBe(201);
  184 |   });
  185 | 
  186 |   test('混合支付（现金 + 微信）', async ({ request }) => {
  187 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  188 |       headers: headers(),
  189 |       data: makeTransaction({
  190 |         items: [serviceItem(SVC_GRADIENT, '渐变美甲', 13800)],
  191 |         method: 'split',
  192 |         split_payments: [
  193 |           { method: 'cash', amount_cents: 5000 },
  194 |           { method: 'wechat_pay', amount_cents: 8800 },
  195 |         ],
  196 |       }),
  197 |     });
  198 |     expect(res.status()).toBe(201);
  199 |   });
  200 | 
  201 |   test('带折扣结账', async ({ request }) => {
  202 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  203 |       headers: headers(),
  204 |       data: makeTransaction({
  205 |         items: [serviceItem(SVC_PURE, '纯色美甲', 8800)],
  206 |         discount_cents: 1000,
  207 |         split_payments: [{ method: 'cash', amount_cents: 7800 }],
  208 |       }),
  209 |     });
  210 |     expect(res.status()).toBe(201);
  211 |     const data = await res.json();
  212 |     expect(data.total_cents).toBe(7800);
  213 |   });
  214 | 
  215 |   test('金额为0应报错', async ({ request }) => {
  216 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  217 |       headers: headers(),
  218 |       data: makeTransaction({
  219 |         items: [serviceItem(SVC_PURE, '纯色美甲', 8800)],
  220 |         split_payments: [{ method: 'cash', amount_cents: 0 }],
  221 |       }),
  222 |     });
  223 |     // 金额不匹配应该报错，不应该 201
> 224 |     expect(res.status()).not.toBe(201);
      |                              ^ Error: expect(received).not.toBe(expected) // Object.is equality
  225 |     expect(res.status()).not.toBe(500);
  226 |   });
  227 | 
  228 |   test('空 items 应报错', async ({ request }) => {
  229 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  230 |       headers: headers(),
  231 |       data: makeTransaction({
  232 |         items: [],
  233 |         split_payments: [{ method: 'cash', amount_cents: 0 }],
  234 |       }),
  235 |     });
  236 |     expect(res.status()).not.toBe(500);
  237 |   });
  238 | 
  239 |   test('无效 service_id 应报错', async ({ request }) => {
  240 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  241 |       headers: headers(),
  242 |       data: makeTransaction({
  243 |         items: [serviceItem('invalid_id', '不存在的服务', 8800)],
  244 |         split_payments: [{ method: 'cash', amount_cents: 8800 }],
  245 |       }),
  246 |     });
  247 |     expect(res.status()).not.toBe(500);
  248 |   });
  249 | });
  250 | 
  251 | // ═══════════════════════════════════════════════════
  252 | // 二、会员做单
  253 | // ═══════════════════════════════════════════════════
  254 | test.describe('会员做单', () => {
  255 | 
  256 |   test('会员 - 单服务现金结账', async ({ request }) => {
  257 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  258 |       headers: headers(),
  259 |       data: makeTransaction({
  260 |         client_id: ADA_ID,
  261 |         items: [serviceItem(SVC_PURE, '纯色美甲', 8800)],
  262 |         split_payments: [{ method: 'cash', amount_cents: 8800 }],
  263 |       }),
  264 |     });
  265 |     expect(res.status()).toBe(201);
  266 |     const data = await res.json();
  267 |     expect(data.status).toBe('completed');
  268 |   });
  269 | 
  270 |   test('会员 - 多服务结账', async ({ request }) => {
  271 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  272 |       headers: headers(),
  273 |       data: makeTransaction({
  274 |         client_id: ADA_ID,
  275 |         items: [
  276 |           serviceItem(SVC_PURE, '纯色美甲', 8800),
  277 |           serviceItem(SVC_GRADIENT, '渐变美甲', 13800),
  278 |           serviceItem(SVC_FOOT, '基础足部护理', 8800),
  279 |         ],
  280 |         split_payments: [{ method: 'cash', amount_cents: 31400 }],
  281 |       }),
  282 |     });
  283 |     expect(res.status()).toBe(201);
  284 |     const data = await res.json();
  285 |     expect(data.total_cents).toBe(31400);
  286 |   });
  287 | 
  288 |   test('会员 - 带小费结账', async ({ request }) => {
  289 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  290 |       headers: headers(),
  291 |       data: makeTransaction({
  292 |         client_id: ADA_ID,
  293 |         items: [serviceItem(SVC_PURE, '纯色美甲', 8800)],
  294 |         tip_cents: 1760,
  295 |         split_payments: [{ method: 'cash', amount_cents: 10560 }],
  296 |       }),
  297 |     });
  298 |     expect(res.status()).toBe(201);
  299 |   });
  300 | 
  301 |   test('会员 - member_card 支付', async ({ request }) => {
  302 |     const res = await request.post(`${BASE}/nail/pos/transactions`, {
  303 |       headers: headers(),
  304 |       data: makeTransaction({
  305 |         client_id: ADA_ID,
  306 |         items: [serviceItem(SVC_PURE, '纯色美甲', 8800)],
  307 |         method: 'member_card',
  308 |         split_payments: [{ method: 'member_card', amount_cents: 8800 }],
  309 |       }),
  310 |     });
  311 |     expect(res.status()).toBe(201);
  312 |   });
  313 | 
  314 |   test('会员 - 消费后 total_spent 和 visits 更新', async ({ request }) => {
  315 |     // 先查当前数据
  316 |     const before = await request.get(`${BASE}/nail/clients/${ADA_ID}`, { headers: headers() });
  317 |     const beforeData = await before.json();
  318 |     const beforeSpent = beforeData.total_spent_cents;
  319 |     const beforeVisits = beforeData.total_visits;
  320 | 
  321 |     // 做一单
  322 |     await request.post(`${BASE}/nail/pos/transactions`, {
  323 |       headers: headers(),
  324 |       data: makeTransaction({
```